Another partial update. More to follow.
[Samba/gebeck_regimport.git] / docs / Samba3-HOWTO / TOSHARG-PDC.xml
blob7518dd6edc3856ddca9710a969875fee2912be54
1 <?xml version="1.0" encoding="iso-8859-1"?>
2 <!DOCTYPE chapter PUBLIC "-//Samba-Team//DTD DocBook V4.2-Based Variant V1.0//EN" "http://www.samba.org/samba/DTD/samba-doc">
3 <chapter id="samba-pdc">
5 <chapterinfo>
6         &author.jht;
7         &author.jerry;
8         &author.dbannon;
9         <author>&person.gd; <contrib>LDAP updates</contrib></author>
10 </chapterinfo>
12 <title>Domain Control</title>
14 <para>
15 There are many who approach MS Windows networking with incredible misconceptions.
16 That's okay, because it gives the rest of us plenty of opportunity to be of assistance.
17 Those who really want help are well advised to become familiar with information
18 that is already available.
19 </para>
21 <para>
22 <indexterm><primary>domain</primary><secondary>controller</secondary></indexterm>
23 You are advised not to tackle this section without having first understood
24 and mastered some basics. MS Windows networking is not particularly forgiving of
25 misconfiguration. Users of MS Windows networking are likely to complain 
26 of persistent niggles that may be caused by a broken network configuration.
27 To a great many people, however, MS Windows networking starts with a domain controller
28 that in some magical way is expected to solve all network operational ills.
29 </para>
31 <para>
32 <link linkend="domain-example">The Example Domain Illustration</link> shows a typical MS Windows domain security
33 network environment. Workstations A, B, and C are representative of many physical MS Windows
34 network clients.
35 </para>
37 <figure id="domain-example">
38         <title>An Example Domain.</title>
39         <imagefile scale="50">domain</imagefile>
40 </figure>
42 <para>
43 From the Samba mailing list we can readily identify many common networking issues.
44 If you are not clear on the following subjects, then it will do much good to read the 
45 sections of this HOWTO that deal with it. These are the most common causes of MS Windows
46 networking problems:
47 </para>
49 <itemizedlist>
50         <listitem><para>Basic TCP/IP configuration.</para></listitem>
51         <listitem><para>NetBIOS name resolution.</para></listitem>
52         <listitem><para>Authentication configuration.</para></listitem>
53         <listitem><para>User and group configuration.</para></listitem>
54         <listitem><para>Basic file and directory permission control in UNIX/Linux.</para></listitem>
55         <listitem><para>Understanding how MS Windows clients interoperate in a network environment.</para></listitem>
56 </itemizedlist>
58 <para>
59 Do not be put off; on the surface of it MS Windows networking seems so simple that anyone 
60 can do it. In fact, it is not a good idea to set up an MS Windows network with
61 inadequate training and preparation. But let's get our first indelible principle out of the
62 way: <emphasis>It is perfectly okay to make mistakes!</emphasis> In the right place and at
63 the right time, mistakes are the essence of learning. It is very much not okay to make
64 mistakes that cause loss of productivity and impose an avoidable financial burden on an
65 organization.
66 </para>
68 <para>
69 Where is the right place to make mistakes? Only out of harms way. If you are going to
70 make mistakes, then please do it on a test network, away from users, and in such a way as
71 to not inflict pain on others. Do your learning on a test network.
72 </para>
74 <sect1>
75 <title>Features and Benefits</title>
77 <para>
78 <indexterm><primary>domain security</primary></indexterm>
79 <emphasis>What is the key benefit of Microsoft Domain Security?</emphasis>
80 </para>
82 <para>
83 <indexterm>single sign-on<primary></primary><see>SSO</see></indexterm>
84 <indexterm><primary>trust</primary></indexterm>
85 <indexterm><primary>account</primary></indexterm>
86 <indexterm><primary>domain</primary><secondary>security</secondary><tertiary>protocols</tertiary></indexterm>
87 In a word, <emphasis>single sign-on</emphasis>, or SSO for short. To many, this is the Holy Grail of MS
88 Windows NT and beyond networking. SSO allows users in a well-designed network to log onto any workstation that
89 is a member of the domain that contains their user account (or in a domain that has an appropriate trust
90 relationship with the domain they are visiting) and they will be able to log onto the network and access
91 resources (shares, files, and printers) as if they are sitting at their home (personal) workstation. This is a
92 feature of the domain security protocols.
93 </para>
95 <para>
96 <indexterm><primary>SID</primary></indexterm>
97 <indexterm><primary>RID</primary></indexterm>
98 <indexterm><primary>relative identifier</primary><see>RID</see></indexterm>
99 <indexterm><primary>security identifier</primary><see>SID</see></indexterm>
100 <indexterm><primary>access control</primary></indexterm>
101 The benefits of domain security are available to those sites that deploy a Samba PDC.  A domain provides a
102 unique network security identifier (SID). Domain user and group security identifiers are comprised of the
103 network SID plus a relative identifier (RID) that is unique to the account. User and group SIDs (the network
104 SID plus the RID) can be used to create access control lists (ACLs) attached to network resources to provide
105 organizational access control. UNIX systems recognize only local security identifiers.
106 </para>
108 <note><para>
109 <indexterm><primary>domain</primary><secondary>member</secondary></indexterm>
110 <indexterm><primary>machine account</primary></indexterm>
111 <indexterm><primary>domain</primary><secondary>trust account</secondary></indexterm>
112 Network clients of an MS Windows domain security environment must be domain members to be able to gain access
113 to the advanced features provided. Domain membership involves more than just setting the workgroup name to the
114 domain name. It requires the creation of a domain trust account for the workstation (called a machine
115 account). Refer to <link linkend="domain-member">Domain Membership</link> for more information.
116 </para></note>
118 <para>
119 The following functionalities are new to the Samba-3 release:
120 </para>
122 <itemizedlist>
123         <listitem><para>
124         <indexterm><primary>account</primary><secondary>backend</secondary></indexterm>
125         Samba-3 supports the use of a choice of backends that may be used in which user, group and machine
126         accounts may be stored. Multiple passwd backends can be used in combination, either as additive backend
127         data sets, or as fail-over data sets.
128         </para>
130         <para>
131         <indexterm><primary>LDAP</primary></indexterm>
132         <indexterm><primary>replicated</primary></indexterm>
133         <indexterm><primary>distributed</primary></indexterm>
134         <indexterm><primary>scalability</primary></indexterm>
135         <indexterm><primary>reliability</primary></indexterm>
136         An LDAP passdb backend confers the benefit that the account backend can be distributed and replicated,
137         which is of great value because it confers scalability and provides a high degree of reliability. 
138         </para></listitem>
140         <listitem><para>
141         <indexterm><primary>interdomain</primary><secondary>trust</secondary><tertiary>account</tertiary></indexterm>
142         <indexterm><primary>trust account</primary><secondary>interdomain</secondary></indexterm>
143         <indexterm><primary>interoperability</primary></indexterm>
144         Windows NT4 domain trusts. Samba-3 supports workstation and server (machine) trust accounts. It also
145         supports Windows NT4 style interdomain trust accounts, which further assists in network scalability
146         and interoperability.
147         </para></listitem>
148         
149         <listitem><para>
150         <indexterm><primary>NetBIOS</primary></indexterm>
151         <indexterm><primary>raw SMB</primary></indexterm>
152         <indexterm><primary>active directory</primary></indexterm>
153         <indexterm><primary>domain</primary><secondary>member server</secondary></indexterm>
154         <indexterm><primary>domain</primary><secondary>controller</secondary></indexterm>
155         <indexterm><primary>network</primary><secondary>browsing</secondary></indexterm>
156         Operation without NetBIOS over TCP/IP, rather using the raw SMB over TCP/IP. Note, this is feasible
157         only when operating as a Microsoft active directory domain member server. When acting as a Samba domain
158         controller the use of NetBIOS is necessary to provide network browsing support.
159         </para></listitem>
161         <listitem><para>
162         <indexterm><primary>WINS</primary></indexterm>
163         <indexterm><primary>TCP port</primary></indexterm>
164         <indexterm><primary>session services</primary></indexterm>
165         Samba-3 provides NetBIOS name services (WINS), NetBIOS over TCP/IP (TCP port 139) session services, SMB over
166         TCP/IP (TCP port 445) session services, and Microsoft compatible ONC DCE RPC services (TCP port 135)
167         services.
168         </para></listitem>
170         <listitem><para>
171         <indexterm><primary>Nexus.exe</primary></indexterm>
172         Management of users and groups via the User Manager for Domains. This can be done on any MS Windows client
173         using the <filename>Nexus.exe</filename> toolkit for Windows 9x/Me, or using the SRVTOOLS.EXE package for MS
174         Windows NT4/200x/XP platforms. These packages are available from Microsoft's Web site.
175         </para></listitem>
177         <listitem><para>
178         Implements full Unicode support. This simplifies cross-locale internationalization support. It also opens up
179         the use of protocols that Samba-2.2.x had but could not use due to the need to fully support Unicode.
180         </para></listitem>
181 </itemizedlist>
183 <para>
184 The following functionalities are not provided by Samba-3:
185 </para>
187 <itemizedlist>
188         <listitem><para>
189         <indexterm><primary>SAM</primary></indexterm>
190         <indexterm><primary>replication</primary></indexterm>
191         SAM replication with Windows NT4 domain controllers (i.e., a Samba PDC and a Windows NT BDC, or vice versa).
192         This means Samba cannot operate as a BDC when the PDC is Microsoft-based Windows NT PDC. Samba-3 can not
193         participate in replication of account data to Windows PDCs and BDCs.
194         </para></listitem>
195         
196         <listitem><para>
197         <indexterm><primary>kerberos</primary></indexterm>
198         <indexterm><primary>active directory</primary></indexterm>
199         Acting as a Windows 2000 active directory domain controller (i.e., Kerberos and Active Directory). In point of
200         fact, Samba-3 does have some Active Directory domain control ability that is at this time purely experimental.
201         Active directory domain control is one of the features that is being developed in Samba-4, the next
202         generation Samba release. At this time there are no plans to enable active directory domain control
203         support during the Samba-3 series life-cycle.
204         </para></listitem>
206         <listitem><para>
207         <indexterm><primary>MMC</primary></indexterm>
208         <indexterm><primary>SVRTOOLS.EXE</primary></indexterm>
209         <indexterm><primary>Microsoft management console</primary><see>MMC</see></indexterm>
210         The Windows 200x/XP Microsoft Management Console (MMC) cannot be used to manage a Samba-3 server. For this you
211         can use only the MS Windows NT4 Domain Server Manager and the MS Windows NT4 Domain User Manager. Both are
212         part of the SVRTOOLS.EXE package mentioned later.
213         </para></listitem>
214 </itemizedlist>
216 <para>
217 <indexterm><primary>Windows XP Home edition</primary></indexterm>
218 <indexterm><primary>LanMan</primary></indexterm>
219 Windows 9x/Me/XP Home clients are not true members of a domain for reasons outlined in this chapter. The
220 protocol for support of Windows 9x/Me-style network (domain) logons is completely different from NT4/Windows
221 200x-type domain logons and has been officially supported for some time. These clients use the old LanMan
222 network logon facilities that are supported in Samba since approximately the Samba-1.9.15 series.
223 </para>
225 <para>
226 <indexterm><primary>group</primary><secondary>mapping</secondary></indexterm>
227 Samba-3 implements group mapping between Windows NT groups and UNIX groups (this is really quite complicated
228 to explain in a short space). This is discussed more fully in <link linkend="groupmapping">Group Mapping: MS
229 Windows and UNIX</link>.
230 </para>
232 <para>
233 <indexterm><primary>machine trust account</primary></indexterm>
234 <indexterm><primary>trust account</primary><secondary>machine</secondary></indexterm>
235 <indexterm><primary>machine account</primary></indexterm>
236 Samba-3, like an MS Windows NT4 PDC or a Windows 200x Active Directory, needs to store user and Machine Trust
237 Account information in a suitable backend data-store.  Refer to <link linkend="machine-trust-accounts">MS
238 Windows Workstation/Server Machine Trust Accounts</link>. With Samba-3 there can be multiple backends for
239 this. A complete discussion of account database backends can be found in <link linkend="passdb">Account
240 Information Databases</link>.
241 </para>
243 </sect1>
245 <sect1>
246 <title>Comparison of Single Sign-on and Domain Security</title>
248 <para>
249 When network administrators  are asked to describe the benefits of Windows NT4 and active directory networking
250 the most often mentioned feature is that of SSO. Many companies have implemented SSO solutions. The mode of
251 implementation of a single sign-on solution is an important factor in the practice of networking in general,
252 and is critical in respect of Windows networking. Where a company may have a wide variety of information
253 systems, each of which require some form of user authentication and validation it is not uncommon that users
254 may need to remember more than a dozen login IDs and passwords. The problem will be compounded when the
255 password for each system must be changed at regular intervals, and particularly so where password uniqueness
256 and history limits are applied.
257 </para>
259 <para>
260 There is a wide perception that SSO is the answer to the problem of users having to deal with too many
261 information system access credentials. Many elaborate schemes have been devised to make it possible to deliver
262 a user-friendly SSO solution. The trouble is that if this implementation is not done correctly, the site may
263 end up paying dearly by way of complexity and management overheads. Simply put, many SSO solutions are an
264 administrative nightmare.
265 </para>
267 <para>
268 SSO implementations may involve centralization of all user account information in one repository. Depending on
269 ... add stuff here JHT!
270 </para>
272 </sect1>
274 <sect1>
275 <title>Basics of Domain Control</title>
277 <para>
278 <indexterm><primary>domain control</primary></indexterm>
279 Over the years, public perceptions of what domain control really is has taken on an almost mystical nature.
280 Before we branch into a brief overview of domain control, there are three basic types of domain controllers.
281 </para>
283 <sect2>
284 <title>Domain Controller Types</title>
286 <itemizedlist>
287         <listitem><para>NT4 style Primary Domain Controller</para></listitem>
288         <listitem><para>NT4 style Backup Domain Controller</para></listitem>
289         <listitem><para>ADS Domain Controller</para></listitem>
290 </itemizedlist>
292 <para>
293 <indexterm><primary>PDC</primary></indexterm>
294 <indexterm><primary>powerful</primary></indexterm>
295 <indexterm><primary>network</primary><secondary>performance</secondary></indexterm>
296 <indexterm><primary>domain</primary><secondary>member</secondary><secondary>server</secondary></indexterm>
297 The <emphasis>Primary Domain Controller</emphasis> or PDC plays an important role in MS Windows NT4. In
298 Windows 200x domain control architecture, this role is held by domain controllers.  Folklore dictates that
299 because of its role in the MS Windows network, the domain controller should be the most powerful and most
300 capable machine in the network.  As strange as it may seem to say this here, good overall network performance
301 dictates that the entire infrastructure needs to be balanced. It is advisable to invest more in standalone
302 (domain member) servers than in the domain controllers.
303 </para>
305 <para>
306 <indexterm><primary>SAM</primary></indexterm>
307 <indexterm><primary>BDC</primary></indexterm>
308 <indexterm><primary>authenticatior</primary></indexterm>
309 <indexterm><primary>synchronization</primary></indexterm>
310 <indexterm><primary>Security Account Manager</primary><see>SAM</see></indexterm>
311 In the case of MS Windows NT4-style domains, it is the PDC that initiates a new domain control database.
312 This forms a part of the Windows registry called the Security Account Manager (SAM). It plays a key
313 part in NT4-type domain user authentication and in synchronization of the domain authentication
314 database with BDCs. 
315 </para>
317 <para>
318 <indexterm><primary>domain</primary><secondary>controller</secondary><tertiary>hierarchy</tertiary></indexterm>
319 <indexterm><primary>LDAP</primary></indexterm>
320 <indexterm>account<primary></primary><secondary>backend</secondary></indexterm>
321 <indexterm><primary>machine account</primary></indexterm>
322 With MS Windows 200x Server-based Active Directory domains, one domain controller initiates a potential
323 hierarchy of domain controllers, each with its own area of delegated control. The master domain
324 controller has the ability to override any downstream controller, but a downline controller has
325 control only over its downline. With Samba-3, this functionality can be implemented using an
326 LDAP-based user and machine account backend.
327 </para>
329 <para>
330 <indexterm><primary>backend database</primary></indexterm>
331 <indexterm><primary>registry</primary></indexterm>
332 New to Samba-3 is the ability to use a backend database that holds the same type of data as the NT4-style SAM
333 database (one of the registry files)<footnote><para>See also <link linkend="passdb">Account Information
334 Databases</link>.</para>.</footnote>
335 </para>
337 <para>
338 <indexterm><primary>BDC</primary></indexterm>
339 <indexterm><primary>PDC</primary></indexterm>
340 <indexterm><primary>WINS</primary></indexterm>
341 <indexterm><primary>authentication</primary></indexterm>
342 <indexterm><primary>netlogon</primary></indexterm>
343 <indexterm><primary>name lookup</primary></indexterm>
344 The <emphasis>Backup Domain Controller</emphasis> or BDC plays a key role in servicing network authentication
345 requests. The BDC is biased to answer logon requests in preference to the PDC.  On a network segment that has
346 a BDC and a PDC, the BDC will most likely service network logon requests. The PDC will answer network logon
347 requests when the BDC is too busy (high load). When a user logs onto a Windows domain member client the
348 workstation will query the network to locate the nearest network logon server. Where a WINS server is used,
349 this is done via a query to the WINS server. If a netlogon server can not be found from the WINS query, or in
350 the absence of a WINS server, the workstation will perform a NetBIOS name lookup via a mailslot broadcast over
351 the UDP broadcast protocol. This means that the netlogon server that the windows client will use is influenced
352 by a number of variables, thus there is no simple determinant of whether a PDC or a BDC will serve a
353 particular logon authentication request.
354 </para>
356 <para>
357 <indexterm><primary>promote</primary></indexterm>
358 <indexterm><primary>demote</primary></indexterm>
359 A Windows NT4 BDC can be promoted to a PDC. If the PDC is online at the time that a BDC is promoted to PDC,
360 the previous PDC is automatically demoted to a BDC. With Samba-3, this is not an automatic operation; the PDC
361 and BDC must be manually configured, and other appropriate changes also need to be made.
362 </para>
364 <para>
365 <indexterm><primary>domain</primary><secondary>controller</secondary><tertiary>convert</tertiary></indexterm>
366 With MS Windows NT4, a decision is made at installation to determine what type of machine the server will be.
367 It is possible to promote a BDC to a PDC, and vice versa. The only method Microsoft provide to convert a
368 Windows NT4 domain controller to a domain member server or a standalone server is to reinstall it. The install
369 time choices offered are:
370 </para>
372 <itemizedlist>
373         <listitem><para><emphasis>Primary Domain Controller</emphasis> &smbmdash; the one that seeds the domain SAM.</para></listitem>
374         <listitem><para><emphasis>Backup Domain Controller</emphasis> &smbmdash; one that obtains a copy of the domain SAM.</para></listitem>
375         <listitem><para><emphasis>Domain Member Server</emphasis> &smbmdash; one that has no copy of the domain SAM; rather
376                 it obtains authentication from a domain controller for all access controls.</para></listitem>
377         <listitem><para><emphasis>Standalone Server</emphasis> &smbmdash; one that plays no part in SAM synchronization,
378                 has its own authentication database, and plays no role in domain security.</para></listitem>
379 </itemizedlist>
381 <note><para>
382 <indexterm><primary>promote</primary></indexterm>
383 Algin Technology LLC provide a commercial tool that makes it possible to promote a Windows NT4 standalone
384 server to a PDC or a BDC, and also permits this process to be reversed. Refer the the <ulink
385 url="http://utools.com/UPromote.asp">Algin</ulink> web site for further information.
386 </para></note>
388 <para>
389 <indexterm><primary>domain</primary><secondary>control</secondary><tertiary>role</tertiary></indexterm>
390 <indexterm><primary>native member</primary></indexterm>
391 Samba-3 servers can readily be converted to and from domain controller roles through simple changes to the
392 &smb.conf; file. Samba-3 is capable of acting fully as a native member of a Windows 200x server Active
393 Directory domain.
394 </para>
396 <para>
397 <indexterm><primary>convert</primary><secondary>domain member server</secondary></indexterm>
398 For the sake of providing a complete picture, MS Windows 2000 domain control configuration is done after the server has been
399 installed. Please refer to Microsoft documentation for the procedures that should be followed to convert a
400 domain member server to or from a domain control, and to install or remove active directory service support.
401 </para>
403 <para>
404 <indexterm><primary>replication</primary><secondary>SAM</secondary></indexterm>
405 <indexterm><primary>SAM</primary><secondary>replication</secondary></indexterm>
406 New to Samba-3 is the ability to function fully as an MS Windows NT4-style domain controller,
407 excluding the SAM replication components. However, please be aware that Samba-3 also supports the
408 MS Windows 200x domain control protocols.
409 </para>
411 <para>
412 <indexterm><primary>ADS</primary></indexterm>
413 At this time any appearance that Samba-3 is capable of acting as a <emphasis>domain controller</emphasis> in
414 native ADS mode is limited and experimental in nature.  This functionality should not be used until the Samba
415 Team offers formal support for it.  At such a time, the documentation will be revised to duly reflect all
416 configuration and management requirements. Samba can act as a NT4-style domain controller in a Windows 2000/XP
417 environment. However, there are certain compromises:
418 </para>
420 <itemizedlist>
421         <listitem><para>No machine policy files.</para></listitem>
422         <listitem><para>No Group Policy Objects.</para></listitem>
423         <listitem><para>No synchronously executed Active Directory logon scripts.</para></listitem>
424         <listitem><para>Can't use Active Directory management tools to manage users and machines.</para></listitem>
425         <listitem><para>Registry changes tattoo the main registry, while with Active Directory they do not leave
426                 permanent changes in effect.</para></listitem>
427         <listitem><para>Without Active Directory you cannot perform the function of exporting specific
428                 applications to specific users or groups.</para></listitem>
429 </itemizedlist>
431 </sect2>
433 <sect2>
434 <title>Preparing for Domain Control</title>
436 <para>
437 <indexterm><primary>standalone</primary></indexterm>
438 <indexterm><primary>workgroup</primary></indexterm>
439 <indexterm><primary>member</primary></indexterm>
440 <indexterm><primary>security</primary></indexterm>
441 There are two ways that MS Windows machines may interact with each other, with other servers,
442 and with domain controllers: either as <emphasis>standalone</emphasis> systems, more commonly
443 called <emphasis>workgroup</emphasis> members, or as full participants in a security system,
444 more commonly called <emphasis>domain</emphasis> members.
445 </para>
447 <para>
448 <indexterm><primary>workgroup</primary></indexterm>
449 <indexterm><primary>workgroup</primary><secondary>membership</secondary></indexterm>
450 <indexterm><primary>machine trust account</primary></indexterm>
451 It should be noted that workgroup membership involves no special configuration other than the machine being
452 configured so the network configuration has a commonly used name for its workgroup entry. It is not uncommon
453 for the name WORKGROUP to be used for this. With this mode of configuration, there are no Machine Trust
454 Accounts, and any concept of membership as such is limited to the fact that all machines appear in the network
455 neighborhood to be logically grouped together. Again, just to be clear: <emphasis>workgroup mode does not
456 involve security machine accounts</emphasis>.
457 </para>
459 <para>
460 <indexterm><primary>domain membership</primary></indexterm>
461 <indexterm><primary>machine trust account</primary><secondary>password</secondary></indexterm>
462 <indexterm><primary>trigger</primary></indexterm>
463 Domain member machines have a machine trust account in the domain accounts database. A special procedure
464 must be followed on each machine to effect domain membership. This procedure, which can be done
465 only by the local machine Administrator account, creates the domain machine account (if it does
466 not exist), and then initializes that account. When the client first logs onto the
467 domain, a machine trust account password change will be automatically triggered.
468 </para>
470 <note><para>
471 <indexterm><primary>domain member</primary></indexterm>
472 When Samba is configured as a domain controller, secure network operation demands that
473 all MS Windows NT4/200x/XP Professional clients should be configured as domain members.
474 If a machine is not made a member of the domain, then it will operate like a workgroup
475 (standalone) machine. Please refer to <link linkend="domain-member">Domain Membership</link>, for
476 information regarding domain membership.
477 </para></note>
479 <para>
480 The following are necessary for configuring Samba-3 as an MS Windows NT4-style PDC for MS Windows
481 NT4/200x/XP clients:
482 </para>
484 <itemizedlist>
485         <listitem><para>Configuration of basic TCP/IP and MS Windows networking.</para></listitem>
486         <listitem><para>Correct designation of the server role (<smbconfoption name="security">user</smbconfoption>).</para></listitem>
487         <listitem><para>Consistent configuration of name resolution.<footnote><para>See <link linkend="NetworkBrowsing">Network Browsing</link>, and 
488                 <link linkend="integrate-ms-networks">Integrating MS Windows Networks with Samba</link>.</para></footnote></para></listitem>
489         <listitem><para>Domain logons for Windows NT4/200x/XP Professional clients.</para></listitem>
490         <listitem><para>Configuration of roaming profiles or explicit configuration to force local profile usage.</para></listitem>
491         <listitem><para>Configuration of network/system policies.</para></listitem>
492         <listitem><para>Adding and managing domain user accounts.</para></listitem>
493         <listitem><para>Configuring MS Windows NT4/2000 Professional and Windows XP Professional client machines to become domain members.</para></listitem>
494 </itemizedlist>
496 <para>
497 The following provisions are required to serve MS Windows 9x/Me clients:
498 </para>
500 <itemizedlist>
501         <listitem><para>Configuration of basic TCP/IP and MS Windows networking.</para></listitem>
502         <listitem><para>Correct designation of the server role (<smbconfoption name="security">user</smbconfoption>).</para></listitem>
503         <listitem><para>Network logon configuration (since Windows 9x/Me/XP Home are not technically domain
504         members, they do not really participate in  the security aspects of Domain logons as such).</para></listitem>
505         <listitem><para>Roaming profile configuration.</para></listitem>
506         <listitem><para>Configuration of system policy handling.</para></listitem>
507         <listitem><para>Installation of the network driver <quote>Client for MS Windows Networks</quote> and configuration
508         to log onto the domain.</para></listitem>
509         <listitem><para>Placing Windows 9x/Me clients in user-level security &smbmdash; if it is desired to allow
510         all client-share access to be controlled according to domain user/group identities.</para></listitem>
511         <listitem><para>Adding and managing domain user accounts.</para></listitem>
512 </itemizedlist>
514 <note><para>
515 <indexterm><primary>roaming profiles</primary></indexterm>
516 <indexterm><primary>account policies</primary></indexterm>
517 Roaming profiles and system/network policies are advanced network administration topics
518 that are covered in <link linkend="ProfileMgmt">Desktop Profile Management</link> and
519 <link linkend="PolicyMgmt">System and Account Policies</link> of this document. However, these are not
520 necessarily specific to a Samba PDC as much as they are related to Windows NT networking concepts.
521 </para></note>
523 <para>
524 A domain controller is an SMB/CIFS server that:
525 </para>
527 <itemizedlist>
528         <listitem><para>
529         <indexterm><primary>NetBIOS</primary><secondary>brooadcast</secondary></indexterm>
530         <indexterm><primary>WINS</primary></indexterm>
531         <indexterm><primary>UDP</primary></indexterm>
532         <indexterm><primary>DNS</primary></indexterm>
533         <indexterm><primary>active directory</primary></indexterm>
534         Registers and advertises itself as a domain controller (through NetBIOS broadcasts
535         as well as by way of name registrations either by Mailslot Broadcasts over UDP broadcast,
536         to a WINS server over UDP unicast, or via DNS and Active Directory).
537         </para></listitem>
539         <listitem><para>
540         <indexterm><primary>NETLOGON</primary></indexterm>
541         <indexterm><primary>LanMan logon service</primary></indexterm>
542         Provides the NETLOGON service. (This is actually a collection of services that runs over
543         multiple protocols. These include the LanMan logon service, the Netlogon service,
544         the Local Security Account service, and variations of them.)
545         </para></listitem>
547         <listitem><para>
548         Provides a share called NETLOGON.
549         </para></listitem>
550 </itemizedlist>
552 <para>
553 <indexterm><primary>domain</primary><secondary>master</secondary><tertiary>browser</tertiary></indexterm>
554 <indexterm><primary>local</primary><secondary>master</secondary><tertiary>browser</tertiary></indexterm>
555 <indexterm><primary>DMB</primary></indexterm>
556 <indexterm><primary>LMB</primary></indexterm>
557 <indexterm><primary>browse list</primary></indexterm>
558 It is rather easy to configure Samba to provide these. Each Samba domain controller must provide the NETLOGON
559 service that Samba calls the <smbconfoption name="domain logons"/> functionality (after the name of the
560 parameter in the &smb.conf; file). Additionally, one server in a Samba-3 domain must advertise itself as the
561 domain master browser.<footnote><para>See <link linkend="NetworkBrowsing">Network
562 Browsing</link>.</para></footnote> This causes the PDC to claim a domain-specific NetBIOS name that identifies
563 it as a DMB for its given domain or workgroup. Local master browsers (LMBs) in the same domain or workgroup on
564 broadcast-isolated subnets then ask for a complete copy of the browse list for the whole wide-area network.
565 Browser clients then contact their LMB, and will receive the domain-wide browse list instead of just the list
566 for their broadcast-isolated subnet.
567 </para>
569 </sect2>
570 </sect1>
572 <sect1>
573 <title>Domain Control: Example Configuration</title>
575 <para>
576 The first step in creating a working Samba PDC is to understand the parameters necessary
577 in &smb.conf;. An example &smb.conf; for acting as a PDC can be found in <link linkend="pdc-example">the
578 smb.conf file for an example PDC</link>. 
579 </para>
581 <example id="pdc-example">
582 <title>smb.conf for being a PDC</title>
583 <smbconfblock>
584 <smbconfsection name="[global]"/>
585 <smbconfoption name="netbios name"><replaceable>BELERIAND</replaceable></smbconfoption>
586 <smbconfoption name="workgroup"><replaceable>&example.workgroup;</replaceable></smbconfoption>
587 <smbconfoption name="passdb backend">tdbsam</smbconfoption>
588 <smbconfoption name="os level">33</smbconfoption>
589 <smbconfoption name="preferred master">auto</smbconfoption>
590 <smbconfoption name="domain master">yes</smbconfoption>
591 <smbconfoption name="local master">yes</smbconfoption>
592 <smbconfoption name="security">user</smbconfoption>
593 <smbconfoption name="domain logons">yes</smbconfoption>
594 <smbconfoption name="logon path">\\%N\profiles\%U</smbconfoption>
595 <smbconfoption name="logon drive">H:</smbconfoption>
596 <smbconfoption name="logon home">\\homeserver\%U\winprofile</smbconfoption>
597 <smbconfoption name="logon script">logon.cmd</smbconfoption>
599 <smbconfsection name="[netlogon]"/>
600 <smbconfoption name="path">/var/lib/samba/netlogon</smbconfoption>
601 <smbconfoption name="read only">yes</smbconfoption>
602 <smbconfoption name="write list"><replaceable>ntadmin</replaceable></smbconfoption>
604 <smbconfsection name="[profiles]"/>
605 <smbconfoption name="path">/var/lib/samba/profiles</smbconfoption>
606 <smbconfoption name="read only">no</smbconfoption>
607 <smbconfoption name="create mask">0600</smbconfoption>
608 <smbconfoption name="directory mask">0700</smbconfoption>
609 </smbconfblock>
610 </example>
612 <para>
613 The basic options shown in <link linkend="pdc-example">this example</link> are explained as follows:
614 </para>
616 <variablelist>
617         <varlistentry><term>passdb backend </term>
618                 <listitem><para>
619                 <indexterm><primary>group</primary><secondary>account</secondary></indexterm>
620                 <indexterm><primary>smbpasswd</primary></indexterm>
621                 <indexterm><primary>tdbsam</primary></indexterm>
622                 <indexterm><primary>ldapsam</primary></indexterm>
623                 <indexterm><primary>guest</primary></indexterm>
624                 <indexterm><primary>default accounts</primary></indexterm>
625                 This contains all the user and group account information. Acceptable values for a PDC
626                 are: <emphasis>smbpasswd, tdbsam, and ldapsam</emphasis>. The <quote>guest</quote> entry provides
627                 default accounts and is included by default; there is no need to add it explicitly.
628                 </para>
630                 <para>
631                 <indexterm><primary>passdb backend</primary></indexterm>
632                 <indexterm><primary>distributed</primary></indexterm>
633                 <indexterm><primary>smbpasswd</primary></indexterm>
634                 <indexterm><primary>tdbsam</primary></indexterm>
635                 Where use of BDCs is intended, the only logical choice is
636                 to use LDAP so the passdb backend can be distributed. The tdbsam and smbpasswd files
637                 cannot effectively be distributed and therefore should not be used.
638                 </para></listitem>
639         </varlistentry>
641         <varlistentry><term>Domain Control Parameters </term>
642                 <listitem><para>
643                 <indexterm><primary>os level</primary></indexterm>
644                 <indexterm><primary>preferred master</primary></indexterm>
645                 <indexterm><primary>domain master</primary></indexterm>
646                 <indexterm><primary>network</primary><secondary>logon</secondary></indexterm>
647                 The parameters <emphasis>os level, preferred master, domain master, security, 
648                 encrypt passwords</emphasis>, and <emphasis>domain logons</emphasis> play a central role in assuring domain
649                 control and network logon support.
650                 </para>
652                 <para>
653                 <indexterm><primary>DMB</primary></indexterm>
654                 <indexterm><primary>encryped password</primary></indexterm>
655                 The <emphasis>os level</emphasis> must be set at or above a value of 32. A domain controller
656                 must be the DMB, must be set in <emphasis>user</emphasis> mode security,
657                 must support Microsoft-compatible encrypted passwords, and must provide the network logon
658                 service (domain logons). Encrypted passwords must be enabled. For more details on how 
659                 to do this, refer to <link linkend="passdb">Account Information Databases</link>.
660                 </para></listitem>
661         </varlistentry>
663         <varlistentry><term>Environment Parameters </term>
664                 <listitem><para>
665                 <indexterm><primary>logon path</primary></indexterm>
666                 <indexterm><primary>logon home</primary></indexterm>
667                 <indexterm><primary>logon drive</primary></indexterm>
668                 <indexterm><primary>logon script</primary></indexterm>
669                 The parameters <emphasis>logon path, logon home, logon drive</emphasis>, and <emphasis>logon script</emphasis> are
670                 environment support settings that help to facilitate client logon operations and that help
671                 to provide automated control facilities to ease network management overheads. Please refer
672                 to the man page information for these parameters.
673                 </para></listitem>
674         </varlistentry>
676         <varlistentry><term>NETLOGON Share </term>
677                 <listitem><para>
678                 <indexterm><primary>NETLOGON</primary></indexterm>
679                 <indexterm><primary>logon processing</primary></indexterm>
680                 <indexterm><primary>domain logon</primary></indexterm>
681                 <indexterm><primary>domain membership</primary></indexterm>
682                 <indexterm><primary>group policy</primary></indexterm>
683                 <indexterm><primary>NTConfig.POL</primary></indexterm>
684                 The NETLOGON share plays a central role in domain logon and domain membership support.
685                 This share is provided on all Microsoft domain controllers. It is used to provide logon
686                 scripts, to store group policy files (NTConfig.POL), as well as to locate other common
687                 tools that may be needed for logon processing. This is an essential share on a domain controller.
688                 </para></listitem>
689         </varlistentry>
691         <varlistentry><term>PROFILE Share </term>
692                 <listitem><para>
693                 <indexterm><primary>desktop profile</primary></indexterm>
694                 <indexterm><primary>VFS</primary></indexterm>
695                 <indexterm><primary>fake_permissions</primary></indexterm>
696                 <indexterm><primary>profile</primary></indexterm>
697                 <indexterm><primary></primary></indexterm>
698                 This share is used to store user desktop profiles. Each user must have a directory at the root
699                 of this share. This directory must be write-enabled for the user and must be globally read-enabled.
700                 Samba-3 has a VFS module called <quote>fake_permissions</quote> that may be installed on this share. This will
701                 allow a Samba administrator to make the directory read-only to everyone. Of course this is useful
702                 only after the profile has been properly created.
703                 </para></listitem>
704         </varlistentry>
705 </variablelist>
707 <note><para>
708 The above parameters make for a full set of functionality that may define the server's mode
709 of operation. The following &smb.conf; parameters are the essentials alone:
710 </para>
712 <para>
713 <smbconfblock>
714 <smbconfoption name="netbios name">BELERIAND</smbconfoption>
715 <smbconfoption name="workgroup">&example.workgroup;</smbconfoption>
716 <smbconfoption name="domain logons">Yes</smbconfoption>
717 <smbconfoption name="domain master">Yes</smbconfoption>
718 <smbconfoption name="security">User</smbconfoption>
719 </smbconfblock>
720 </para>
722 <para>
723 The additional parameters shown in the longer listing in this section just make for
724 a more complete explanation.
725 </para></note>
727 </sect1>
729 <sect1>
730 <title>Samba ADS Domain Control</title>
732 <para>
733 <indexterm><primary>active directory</primary></indexterm>
734 Samba-3 is not, and cannot act as, an Active Directory server. It cannot truly function as an Active Directory
735 PDC. The protocols for some of the functionality of Active Directory domain controllers has been partially
736 implemented on an experimental only basis. Please do not expect Samba-3 to support these protocols. Do not
737 depend on any such functionality either now or in the future. The Samba Team may remove these experimental
738 features or may change their behavior. This is mentioned for the benefit of those who have discovered secret
739 capabilities in Samba-3 and who have asked when this functionality will be completed. The answer is maybe
740 someday or maybe never!
741 </para>
743 <para>
744 <indexterm><primary>domain controllers</primary></indexterm>
745 <indexterm><primary>active directory</primary></indexterm>
746 To be sure, Samba-3 is designed to provide most of the functionality that Microsoft Windows NT4-style
747 domain controllers have. Samba-3 does not have all the capabilities of Windows NT4, but it does have
748 a number of features that Windows NT4 domain controllers do not have. In short, Samba-3 is not NT4 and it
749 is not Windows Server 200x: it is not an Active Directory server. We hope this is plain and simple
750 enough for all to understand.
751 </para>
753 </sect1>
755 <sect1>
756 <title>Domain and Network Logon Configuration</title>
758 <para>
759 <indexterm><primary>domain logon</primary></indexterm>
760 The subject of network or domain logons is discussed here because it forms
761 an integral part of the essential functionality that is provided by a domain controller.
762 </para>
764 <sect2>
765 <title>Domain Network Logon Service</title>
767 <para>
768 <indexterm><primary>domain logon</primary></indexterm>
769 All domain controllers must run the netlogon service (<emphasis>domain logons</emphasis>
770 in Samba). One domain controller must be configured with <smbconfoption name="domain master">Yes</smbconfoption>
771 (the PDC); on all BDCs set the parameter <smbconfoption name="domain master">No</smbconfoption>.
772 </para>
774 <sect3>
775 <title>Example Configuration</title>
777 <example id="PDC-config">
778 <title>smb.conf for being a PDC</title>
779 <smbconfblock>
780 <smbconfsection name="[global]"/>
781 <smbconfoption name="domain logons">Yes</smbconfoption>
782 <smbconfoption name="domain master">(Yes on PDC, No on BDCs)</smbconfoption>
784 <smbconfsection name="[netlogon]"/>
785 <smbconfoption name="comment">Network Logon Service</smbconfoption>
786 <smbconfoption name="path">/var/lib/samba/netlogon</smbconfoption>
787 <smbconfoption name="guest ok">Yes</smbconfoption>
788 <smbconfoption name="browseable">No</smbconfoption>
789 </smbconfblock>
790 </example>
792 </sect3>
793 <sect3>
794 <title>The Special Case of MS Windows XP Home Edition</title>
796 <para>
797 <indexterm><primary>Windows XP Home edition</primary></indexterm>
798 To be completely clear: If you want MS Windows XP Home Edition to integrate with your
799 MS Windows NT4 or Active Directory domain security, understand it cannot be done.
800 The only option is to purchase the upgrade from MS Windows XP Home Edition to
801 MS Windows XP Professional.
802 </para>
804 <note><para>
805 MS Windows XP Home Edition does not have the ability to join any type of domain
806 security facility. Unlike MS Windows 9x/Me, MS Windows XP Home Edition also completely
807 lacks the ability to log onto a network.
808 </para></note>
810 <para>
811 Now that this has been said, please do not ask the mailing list or email any of the
812 Samba Team members with your questions asking how to make this work. It can't be done.
813 If it can be done, then to do so would violate your software license agreement with
814 Microsoft, and we recommend that you do not do that.
815 </para>
817 </sect3>
819 <sect3>
820 <title>The Special Case of Windows 9x/Me</title>
822 <para>
823 <indexterm><primary>domain</primary></indexterm>
824 <indexterm><primary>workgroup</primary></indexterm>
825 <indexterm><primary>authentication</primary></indexterm>
826 <indexterm><primary>browsing</primary></indexterm>
827 <indexterm><primary>rights</primary></indexterm>
828 A domain and a workgroup are exactly the same in terms of network
829 browsing. The difference is that a distributable authentication
830 database is associated with a domain, for secure login access to a
831 network. Also, different access rights can be granted to users if they
832 successfully authenticate against a domain logon server. Samba-3 does this
833 now in the same way as MS Windows NT/200x.
834 </para>
836 <para>
837 <indexterm><primary>browsing</primary></indexterm>
838 The SMB client logging on to a domain has an expectation that every other
839 server in the domain should accept the same authentication information.
840 Network browsing functionality of domains and workgroups is identical and
841 is explained in this documentation under the browsing discussions.
842 It should be noted that browsing is totally orthogonal to logon support.
843 </para>
845 <para>
846 <indexterm><primary>single-logon</primary></indexterm>
847 <indexterm><primary>domain logons</primary></indexterm>
848 <indexterm><primary>network logon</primary></indexterm>
849 Issues related to the single-logon network model are discussed in this
850 section. Samba supports domain logons, network logon scripts, and user
851 profiles for MS Windows for Workgroups and MS Windows 9x/Me clients,
852 which are the focus of this section.
853 </para>
855 <para>
856 <indexterm><primary>broadcast request</primary></indexterm>
857 When an SMB client in a domain wishes to log on, it broadcasts requests for a logon server. The first one to
858 reply gets the job and validates its password using whatever mechanism the Samba administrator has installed.
859 It is possible (but ill advised) to create a domain where the user database is not shared between servers;
860 that is, they are effectively workgroup servers advertising themselves as participating in a domain. This
861 demonstrates how authentication is quite different from but closely involved with domains.
862 </para>
864 <para>
865 Using these features, you can make your clients verify their logon via
866 the Samba server, make clients run a batch file when they log on to
867 the network and download their preferences, desktop, and start menu.
868 </para>
870 <para><emphasis>
871 MS Windows XP Home edition is not able to join a domain and does not permit the use of domain logons.
872 </emphasis></para>
874 <para>
875 Before launching into the configuration instructions, it is worthwhile to look at how a Windows 9x/Me client
876 performs a logon:
877 </para>
879 <orderedlist>
880 <listitem>
881         <para>
882         <indexterm><primary>DOMAIN&lt;#1C&gt;</primary></indexterm>
883         <indexterm><primary>logon server</primary></indexterm>
884         The client broadcasts (to the IP broadcast address of the subnet it is in)
885         a NetLogon request. This is sent to the NetBIOS name DOMAIN&lt;#1C&gt; at the
886         NetBIOS layer. The client chooses the first response it receives, which
887         contains the NetBIOS name of the logon server to use in the format of 
888         <filename>\\SERVER</filename>. The <literal>#1C</literal> name is the name
889         type that is registered by domain controllers (SMB/CIFS servers that provide
890         the netlogon service).
891         </para>
892 </listitem>
894 <listitem>
895         <para>
896         <indexterm><primary>IPC$</primary></indexterm>
897         <indexterm><primary>SMBsessetupX</primary></indexterm>
898         <indexterm><primary>SMBtconX</primary></indexterm>
899         The client connects to that server, logs on (does an SMBsessetupX) and
900         then connects to the IPC$ share (using an SMBtconX).
901         </para>
902 </listitem>
904 <listitem>
905         <para>
906         <indexterm><primary>NetWkstaUserLogon</primary></indexterm>
907         The client does a NetWkstaUserLogon request, which retrieves the name
908         of the user's logon script. 
909         </para>
910 </listitem>
912 <listitem>
913         <para>
914         The client then connects to the NetLogon share and searches for said script.    
915         If it is found and can be read, it is retrieved and executed by the client.
916         After this, the client disconnects from the NetLogon share.
917         </para>
918 </listitem>
920 <listitem>
921         <para>
922         <indexterm><primary>NetUserGetInfo</primary></indexterm>
923         <indexterm><primary>profile</primary></indexterm>
924         The client sends a NetUserGetInfo request to the server to retrieve
925         the user's home share, which is used to search for profiles. Since the
926         response to the NetUserGetInfo request does not contain much more than  
927         the user's home share, profiles for Windows 9x clients must reside in the user
928         home directory.
929         </para>
930 </listitem>
932 <listitem>
933         <para>
934         <indexterm><primary>profiles</primary></indexterm>
935         The client connects to the user's home share and searches for the 
936         user's profile. As it turns out, you can specify the user's home share as
937         a share name and path. For example, <filename>\\server\fred\.winprofile</filename>.
938         If the profiles are found, they are implemented.
939         </para>
940 </listitem>
942 <listitem>
943         <para>
944         <indexterm><primary>CONFIG.POL</primary></indexterm>
945         The client then disconnects from the user's home share and reconnects to
946         the NetLogon share and looks for <filename>CONFIG.POL</filename>, the policies file. If this is
947         found, it is read and implemented.
948         </para>
949 </listitem>
950 </orderedlist>
952 <para>
953 The main difference between a PDC and a Windows 9x/Me logon server configuration is:
954 </para>
956 <itemizedlist>
957 <listitem><para>
958         <indexterm><primary>password</primary><secondary>plaintext</secondary></indexterm>
959         <indexterm><primary>plaintext password</primary></indexterm>
960         Password encryption is not required for a Windows 9x/Me logon server. But note
961         that beginning with MS Windows 98 the default setting is that plaintext
962         password support is disabled. It can be re-enabled with the registry
963         changes that are documented in <link linkend="PolicyMgmt">System and Account Policies</link>.
964         </para></listitem>
966         <listitem><para>
967         <indexterm><primary>machine trust account</primary></indexterm>
968         Windows 9x/Me clients do not require and do not use Machine Trust Accounts.
969         </para></listitem>
970 </itemizedlist>
972 <para>
973 <indexterm><primary>network logon services</primary></indexterm>
974 A Samba PDC will act as a Windows 9x/Me logon server; after all, it does provide the
975 network logon services that MS Windows 9x/Me expect to find.
976 </para>
978 <note><para>
979 <indexterm><primary>sniffer</primary></indexterm>
980 Use of plaintext passwords is strongly discouraged. Where used they are easily detected
981 using a sniffer tool to examine network traffic.
982 </para></note>
984 </sect3>
985 </sect2>
987 <sect2>
988 <title>Security Mode and Master Browsers</title>
990 <para>
991 <indexterm><primary>security mode</primary></indexterm>
992 <indexterm><primary>user-mode security</primary></indexterm>
993 <indexterm><primary>share-mode security</primary></indexterm>
994 There are a few comments to make in order to tie up some loose ends. There has been much debate over the issue
995 of whether it is okay to configure Samba as a domain controller that operates with security mode other than
996 user-mode. The only security mode that will not work due to technical reasons is share-mode security. Domain
997 and server mode security are really just a variation on SMB user-level security.
998 </para>
1000 <para>
1001 <indexterm><primary>DOMAIN&lt;1C&gt;</primary></indexterm>
1002 <indexterm><primary>DOMAIN&lt;#1B&gt;</primary></indexterm>
1003 <indexterm><primary>DMB</primary></indexterm>
1004 <indexterm><primary>PDC</primary></indexterm>
1005 <indexterm><primary>NetBIOS name</primary></indexterm>
1006 <indexterm><primary>domain controller</primary></indexterm>
1007 <indexterm><primary>election</primary></indexterm>
1008 Actually, this issue is also closely tied to the debate on whether Samba must be the DMB for its workgroup
1009 when operating as a domain controller.  In a pure Microsoft Windows NT domain, the PDC wins the election to be
1010 the DMB, and then registers the DOMAIN&lt;#1B&gt; NetBIOS name. This is not the name used by Windows clients
1011 to locate the domain controller, all domain controllers register the DOMAIN&lt;1C&gt; name and Windows clients
1012 locate a network logon server by seraching for the DOMAIN&lt;1C&gt; name.  A DMB is a Domain Master Browser
1013 &smbmdash; see <link linkend="NetworkBrowsing">The Network Browsing Chapter</link>, <link
1014 linkend="DMB">Configuring WORKGROUP Browsing</link>; Microsoft PDCs expect to win the election to become the
1015 DMB, if it loses that election it will report a continuous and rapid sequence of warning messages to its
1016 Windows event logger complaining that it has lost the election to become a DMB.  For this reason, in networks
1017 where a Samba server is the PDC it is wise to configure the Samba domain controller as the DMB.
1018 </para>
1020 <note><para>
1021 <indexterm><primary>DOMAIN&lt;1D&gt;</primary></indexterm>
1022 <indexterm><primary>synchronization</primary></indexterm>
1023 <indexterm><primary>domain control</primary></indexterm>
1024 <indexterm><primary>browse list management</primary></indexterm>
1025 <indexterm><primary>network</primary><secondary>logon</secondary><tertiary>service</tertiary></indexterm>
1026 SMB/CIFS servers that register the DOMAIN&lt;1C&gt; name do so because they provide the network logon
1027 service. Server that register the DOMAIN&lt;1B&gt; name are DMBs &smbmdash; meaning that they are responsible
1028 for browse list synchronization across all machines that have registered the DOMAIN&lt;1D&gt; name. The later
1029 are LMBs that have the responsibility to listen to all NetBIOS name registrations that occur locally to their
1030 own network segment. The network logon service (NETLOGON) is germane to domain control and has nothing to do
1031 with network browsing and browse list management. The #1C and #1B/#1D name services are orthogonal to each
1032 other.
1033 </para></note>
1035 <para>
1036 Now back to the issue of configuring a Samba domain controller to use a mode other than <smbconfoption
1037 name="security">user</smbconfoption>. If a Samba host is configured to use another SMB server or domain
1038 controller in order to validate user connection requests, it is a fact that some other machine on the network
1039 (the <smbconfoption name="password server"/>) knows more about the user than the Samba host. About 99 percent
1040 of the time, this other host is a domain controller. Now to operate in domain mode security, the
1041 <smbconfoption name="workgroup"/> parameter must be set to the name of the Windows NT domain (which already
1042 has a domain controller).  If the domain does not already have a domain controller, you do not yet have a
1043 domain.
1044 </para>
1046 <para>
1047 Configuring a Samba box as a domain controller for a domain that already by definition has a
1048 PDC is asking for trouble. Therefore, you should always configure the Samba domain controller
1049 to be the DMB for its domain and set <smbconfoption name="security">user</smbconfoption>.
1050 This is the only officially supported mode of operation.
1051 </para>
1053 </sect2>
1055 </sect1>
1057 <sect1>
1058 <title>Common Errors</title>
1060 <sect2>
1061 <title><quote>$</quote> Cannot Be Included in Machine Name</title>
1063 <para>
1064 <indexterm><primary>BSD</primary></indexterm>
1065 <indexterm><primary>FreeBSD</primary></indexterm>
1066 <indexterm><primary>/etc/passwd</primary></indexterm>
1067 A machine account, typically stored in <filename>/etc/passwd</filename>, takes the form of the machine
1068 name with a <quote>$</quote> appended. Some BSD systems will not create a user with a <quote>$</quote> in the name.
1069 Recent versions of FreeBSD have removed this limitation, but older releases are still in common use.
1070 </para>
1072 <para>
1073 <indexterm><primary>vipw</primary></indexterm>
1074 The problem is only in the program used to make the entry. Once made, it works perfectly.  Create a user
1075 without the <quote>$</quote>. Then use <command>vipw</command> to edit the entry, adding the <quote>$</quote>.
1076 Or create the whole entry with vipw if you like; make sure you use a unique user login ID.
1077 </para>
1079 <note><para>The machine account must have the exact name that the workstation has.</para></note>
1081 <note><para>
1082 The UNIX tool <command>vipw</command> is a common tool for directly editing the <filename>/etc/passwd</filename> file.
1083 The use of vipw will ensure that shadow files (where used) will remain current with the passwd file. This is
1084 important for security reasons.
1085 </para></note>
1087 </sect2>
1089 <sect2>
1090 <title>Joining Domain Fails Because of Existing Machine Account</title>
1091                 
1092 <para>
1093 <indexterm><primary>join domain</primary></indexterm>
1094 <quote>I get told, `You already have a connection to the Domain....' or `Cannot join domain, the
1095 credentials supplied conflict with an existing set...' when creating a Machine Trust Account.</quote>
1096 </para>
1098 <para>
1099 This happens if you try to create a Machine Trust Account from the machine itself and already have a
1100 connection (e.g., mapped drive) to a share (or IPC$) on the Samba PDC. The following command will remove all
1101 network drive connections:
1102 <screen>
1103 &dosprompt;<userinput>net use * /d</userinput>
1104 </screen>
1105 This will break all network connections.
1106 </para>
1108 <para>
1109 Further, if the machine is already a <quote>member of a workgroup</quote> that is the same name as the domain
1110 you are joining (bad idea), you will get this message. Change the workgroup name to something else &smbmdash;
1111 it does not matter what &smbmdash; reboot, and try again.
1112 </para>
1114 </sect2>
1116 <sect2>
1117 <title>The System Cannot Log You On (C000019B)</title>
1119 <para><quote>
1120 I joined the domain successfully but after upgrading to a newer version of the Samba code I get the message,
1121 <errorname>`The system cannot log you on (C000019B). Please try again or consult your system
1122 administrator</errorname> when attempting to logon.'</quote>
1123 </para>
1125 <para>
1126 <indexterm><primary>SID</primary></indexterm>
1127 This occurs when the domain SID stored in the secrets.tdb database is changed. The most common cause of a
1128 change in domain SID is when the domain name and/or the server name (NetBIOS name) is changed.  The only way
1129 to correct the problem is to restore the original domain SID or remove the domain client from the domain and
1130 rejoin. The domain SID may be reset using either the net or rpcclient utilities.
1131 </para>
1133 <para>
1134 To reset or change the domain SID you can use the net command as follows:
1136 <screen>
1137 &rootprompt;<userinput>net getlocalsid 'OLDNAME'</userinput>
1138 &rootprompt;<userinput>net setlocalsid 'SID'</userinput>
1139 </screen>
1140 </para>
1142 <para>
1143 Workstation Machine Trust Accounts work only with the domain (or network) SID. If this SID changes,
1144 domain members (workstations) will not be able to log onto the domain. The original domain SID
1145 can be recovered from the secrets.tdb file. The alternative is to visit each workstation to rejoin
1146 it to the domain.
1147 </para>
1149 </sect2>
1151 <sect2>
1152 <title>The Machine Trust Account Is Not Accessible</title>
1154 <para>
1155 <quote>When I try to join the domain I get the message, <errorname>"The machine account 
1156 for this computer either does not exist or is not accessible</errorname>." What's wrong?</quote>
1157 </para>
1159 <para>
1160 This problem is caused by the PDC not having a suitable Machine Trust Account.  If you are using the
1161 <smbconfoption name="add machine script"/> method to create accounts, then this would indicate that it has not
1162 worked. Ensure the domain admin user system is working.
1163 </para>
1165 <para>
1166 Alternately, if you are creating account entries manually, then they have not been created correctly. Make
1167 sure that you have the entry correct for the Machine Trust Account in <filename>smbpasswd</filename> file on
1168 the Samba PDC.  If you added the account using an editor rather than using the smbpasswd utility, make sure
1169 that the account name is the machine NetBIOS name with a <quote>$</quote> appended to it (i.e.,
1170 computer_name$). There must be an entry in both the POSIX UNIX system account backend as well as in the
1171 SambaSAMAccount backend. The default backend for Samba-3 (i.e., the parameter <parameter>passdb
1172 backend</parameter> is not specified in the &smb.conf; file, or if specified is set to
1173 <literal>smbpasswd</literal>, are respectively the <filename>/etc/passwd</filename> and
1174 <filename>/etc/samba/smbpasswd</filename> (or <filename>/usr/local/samba/lib/private/smbpasswd</filename> if
1175 compiled using Samba Team default settings). The use of the <filename>/etc/passwd</filename> can be overridden
1176 by alternative settings in the NSS <filename>/etc/nsswitch.conf</filename> file.
1177 </para>
1179 <para>
1180 Some people have also reported that inconsistent subnet masks between the Samba server and the NT 
1181 client can cause this problem.  Make sure that these are consistent for both client and server.
1182 </para>
1183 </sect2>
1185 <sect2>
1186 <title>Account Disabled</title>
1188 <para><quote>When I attempt to log in to a Samba domain from a NT4/W200x workstation,
1189 I get a message about my account being disabled.</quote></para>
1191 <para>
1192 Enable the user accounts with <userinput>smbpasswd -e <replaceable>username</replaceable>
1193 </userinput>. This is normally done as an account is created.
1194 </para>
1196 </sect2>
1198 <sect2>
1199 <title>Domain Controller Unavailable</title>
1200                 
1201 <para><quote>Until a few minutes after Samba has started, clients get the error `Domain Controller Unavailable'</quote></para>
1203 <para>
1204 A domain controller has to announce its role on the network. This usually takes a while. Be patient for up to 15 minutes,
1205 then try again.
1206 </para>
1207 </sect2>
1209 <sect2>
1210 <title>Cannot Log onto Domain Member Workstation After Joining Domain</title>
1212 <para>
1213 <indexterm><primary>schannel</primary></indexterm>
1214 <indexterm><primary>signing</primary></indexterm>
1215 After successfully joining the domain, user logons fail with one of two messages: one to the
1216 effect that the domain controller cannot be found; the other claims that the account does not
1217 exist in the domain or that the password is incorrect. This may be due to incompatible
1218 settings between the Windows client and the Samba-3 server for <emphasis>schannel</emphasis>
1219 (secure channel) settings or <emphasis>smb signing</emphasis> settings. Check your Samba
1220 settings for <emphasis>client schannel</emphasis>, <emphasis>server schannel</emphasis>,
1221 <emphasis>client signing</emphasis>, <emphasis>server signing</emphasis> by executing:
1222 <screen>
1223 <command>testparm -v | grep channel</command> and looking for the value of these parameters.
1224 </screen>
1225 </para>
1227 <para>
1228 Also use the MMC &smbmdash; Local Security Settings. This tool is available from the
1229 Control Panel. The Policy settings are found in the Local Policies/Security Options area and are prefixed by
1230 <emphasis>Secure Channel:..., and Digitally sign...</emphasis>.
1231 </para>
1233 <para>
1234 It is important that these be set consistently with the Samba-3 server settings.
1235 </para>
1237 </sect2>
1239 </sect1>
1240 </chapter>