This commit was manufactured by cvs2svn to create branch 'SAMBA_3_0'.(This used to...
[ira/wip.git] / docs / docbook / projdoc / Samba-PDC-HOWTO.xml
1 <chapter id="samba-pdc">
2
3
4 <chapterinfo>
5         &author.jerry;
6         &author.jht;
7         <author>
8                 <firstname>David</firstname><surname>Bannon</surname>
9                 <affiliation>
10                         <orgname>Samba Team</orgname>
11                         <address><email>dbannon@samba.org</email></address>
12                 </affiliation>
13         </author>
14         <pubdate> (26 Apr 2001) </pubdate>
15 </chapterinfo>
16
17 <title>
18 Samba as an NT4 or Win2k Primary Domain Controller
19 </title>
20
21
22 <sect1>
23 <title>Prerequisite Reading</title>
24
25 <para>
26 Before you continue reading in this chapter, please make sure 
27 that you are comfortable with configuring basic files services
28 in smb.conf and how to enable and administer password 
29 encryption in Samba.  Theses two topics are covered in the
30 &smb.conf; manpage.
31 </para>
32
33
34 </sect1>
35
36
37
38 <sect1>
39 <title>
40 Background
41 </title>
42
43 <para>
44 This article outlines the steps necessary for configuring Samba as a PDC.
45 It is necessary to have a working Samba server prior to implementing the
46 PDC functionality.
47 </para>
48
49 <itemizedlist>
50         <listitem><para>
51         Domain logons for Windows NT 4.0 / 200x / XP Professional clients.
52         </para></listitem>
53         
54         <listitem><para>
55         Placing Windows 9x / Me clients in user level security
56         </para></listitem>
57         
58         <listitem><para>
59         Retrieving a list of users and groups from a Samba PDC to
60         Windows 9x / Me / NT / 200x / XP Professional clients
61         </para></listitem>
62         
63         <listitem><para>
64         Roaming Profiles
65         </para></listitem>
66         
67         <listitem><para>
68         Network/System Policies
69         </para></listitem>
70 </itemizedlist>
71
72 <note>
73 <para>
74 Roaming Profiles and System/Network policies are advanced network administration topics
75 that are covered separately in this document.
76 </para>
77 </note>
78
79 <para>
80 The following functionalities are new to the Samba 3.0 release:
81 </para>
82
83 <itemizedlist>
84         <listitem><para>
85         Windows NT 4 domain trusts
86         </para></listitem>
87         
88         <listitem><para>
89         Adding users via the User Manager for Domains
90         </para></listitem>
91 </itemizedlist>
92
93 <para>
94 The following functionalities are NOT provided by Samba 3.0:
95 </para>
96
97 <itemizedlist>
98         <listitem><para>
99         SAM replication with Windows NT 4.0 Domain Controllers
100         (i.e. a Samba PDC and a Windows NT BDC or vice versa) 
101         </para></listitem>
102         
103         <listitem><para>
104         Acting as a Windows 2000 Domain Controller (i.e. Kerberos and 
105         Active Directory)
106         </para></listitem>
107 </itemizedlist>
108
109 <para>
110 Please note that Windows 9x / Me / XP Home clients are not true members of a domain
111 for reasons outlined in this article.  Therefore the protocol for
112 support of Windows 9x-style domain logons is completely different
113 from NT4 / Win2k type domain logons and has been officially supported for some 
114 time.
115 </para>
116
117 <para><emphasis>
118 MS Windows XP Home edition is NOT able to join a domain and does not permit
119 the use of domain logons.</emphasis>
120 </para>
121
122
123 <para>
124 Implementing a Samba PDC can basically be divided into 3 broad
125 steps.
126 </para>
127
128 <orderedlist numeration="arabic">
129         <listitem><para>
130         Configuring the Samba PDC
131         </para></listitem>
132         
133         <listitem><para>
134         Creating machine trust accounts and joining clients to the domain
135         </para></listitem>
136
137         <listitem><para>
138         Adding and managing domain user accounts
139         </para></listitem>
140 </orderedlist>
141
142 <para>
143 There are other minor details such as user profiles, system
144 policies, etc...  However, these are not necessarily specific
145 to a Samba PDC as much as they are related to Windows NT networking
146 concepts.
147 </para>
148
149 </sect1>
150
151
152 <sect1>
153 <title>Configuring the Samba Domain Controller</title>
154
155 <para>
156 The first step in creating a working Samba PDC is to 
157 understand the parameters necessary in smb.conf. Here we
158 attempt to explain the parameters that are covered in
159 the &smb.conf; man page.
160 </para>
161
162 <para>
163 Here is an example &smb.conf; for acting as a PDC:
164 </para>
165
166 <para><programlisting>
167 [global]
168     ; Basic server settings
169     <ulink url="smb.conf.5.html#NETBIOSNAME">netbios name</ulink> = <replaceable>POGO</replaceable>
170     <ulink url="smb.conf.5.html#WORKGROUP">workgroup</ulink> = <replaceable>NARNIA</replaceable>
171
172     ; User and Machine Account Backends
173     ; Choices are: tdbsam, tdbsam_nua, smbpasswd, smbpasswd_nua, ldapsam, ldapsam_nua, ...
174     ;              mysqlsam, xmlsam, guest
175     <ulink url="smb.conf.5.html#PASSDBBACKEND">passdb backend</ulink> = ldapsam, guest
176
177     ; we should act as the domain and local master browser
178     <ulink url="smb.conf.5.html#OSLEVEL">os level</ulink> = 64
179     <ulink url="smb.conf.5.html#PERFERREDMASTER">preferred master</ulink> = yes
180     <ulink url="smb.conf.5.html#DOMAINMASTER">domain master</ulink> = yes
181     <ulink url="smb.conf.5.html#LOCALMASTER">local master</ulink> = yes
182     
183     ; security settings (must user security = user)
184     <ulink url="smb.conf.5.html#SECURITYEQUALSUSER">security</ulink> = user
185     
186     ; encrypted passwords are a requirement for a PDC
187     <ulink url="smb.conf.5.html#ENCRYPTPASSWORDS">encrypt passwords</ulink> = yes
188     
189     ; support domain logons
190     <ulink url="smb.conf.5.html#DOMAINLOGONS">domain logons</ulink> = yes
191     
192     ; where to store user profiles?
193     <ulink url="smb.conf.5.html#LOGONPATH">logon path</ulink> = \\%N\profiles\%u
194     
195     ; where is a user's home directory and where should it be mounted at?
196     <ulink url="smb.conf.5.html#LOGONDRIVE">logon drive</ulink> = H:
197     <ulink url="smb.conf.5.html#LOGONHOME">logon home</ulink> = \\homeserver\%u
198     
199     ; specify a generic logon script for all users
200     ; this is a relative **DOS** path to the [netlogon] share
201     <ulink url="smb.conf.5.html#LOGONSCRIPT">logon script</ulink> = logon.cmd
202
203 ; necessary share for domain controller
204 [netlogon]
205     <ulink url="smb.conf.5.html#PATH">path</ulink> = /usr/local/samba/lib/netlogon
206     <ulink url="smb.conf.5.html#READONLY">read only</ulink> = yes
207     <ulink url="smb.conf.5.html#WRITELIST">write list</ulink> = <replaceable>ntadmin</replaceable>
208     
209 ; share for storing user profiles
210 [profiles]
211     <ulink url="smb.conf.5.html#PATH">path</ulink> = /export/smb/ntprofile
212     <ulink url="smb.conf.5.html#READONLY">read only</ulink> = no
213     <ulink url="smb.conf.5.html#CREATEMASK">create mask</ulink> = 0600
214     <ulink url="smb.conf.5.html#DIRECTORYMASK">directory mask</ulink> = 0700
215 </programlisting></para>
216
217 <note><para>
218 The above parameters make for a full set of parameters that may define the server's mode
219 of operation. The following parameters are the essentials alone:
220
221 <programlisting>
222         workgroup = NARNIA
223         domain logons = Yes
224         security = User
225 </programlisting>
226
227 The additional parameters shown in the longer listing above just makes for a
228 more complete environment.
229 </para></note>
230
231 <para>
232 There are a couple of points to emphasize in the above configuration.
233 </para>
234
235 <itemizedlist>
236         <listitem><para>
237         Encrypted passwords must be enabled.  For more details on how 
238         to do this, refer to <link linkend="passdb">the User Database chapter</link>.
239         </para></listitem>
240         
241         <listitem><para>
242         The server must support domain logons and a
243         <filename>[netlogon]</filename> share
244         </para></listitem>
245         
246         <listitem><para>
247         The server must be the domain master browser in order for Windows 
248         client to locate the server as a DC.  Please refer to the various 
249         Network Browsing documentation included with this distribution for 
250         details.
251         </para></listitem>
252 </itemizedlist>    
253
254 <para>
255 Samba 3.0 offers a complete implementation of group mapping
256 between Windows NT groups and Unix groups (this is really quite
257 complicated to explain in a short space).
258 </para>
259
260 </sect1>
261
262
263 <sect1>
264 <title>Creating Machine Trust Accounts and Joining Clients to the Domain</title>
265
266 <para>
267 A machine trust account is a Samba account that is used to
268 authenticate a client machine (rather than a user) to the Samba
269 server.  In Windows terminology, this is known as a "Computer
270 Account."</para>
271
272 <para>
273 The password of a machine trust account acts as the shared secret for
274 secure communication with the Domain Controller.  This is a security
275 feature to prevent an unauthorized machine with the same NetBIOS name
276 from joining the domain and gaining access to domain user/group
277 accounts.  Windows NT, 200x, XP Professional clients use machine trust
278 accounts, but Windows 9x / Me / XP Home clients do not.  Hence, a
279 Windows 9x / Me / XP Home  client is never a true member of a domain
280 because it does not possess a machine trust account, and thus has no
281 shared secret with the domain controller.
282 </para>
283
284 <para>A Windows PDC stores each machine trust account in the Windows
285 Registry. A Samba-3 PDC also has to store machine trust account information
286 in a suitable backend data store. With Samba-3 there can be multiple back-ends
287 for this including:
288 </para>
289
290 <itemizedlist>
291         <listitem><para>
292         <emphasis>smbpasswd</emphasis> - the plain ascii file stored used by
293         earlier versions of Samba. This file configuration option requires
294         a Unix/Linux system account for EVERY entry (ie: both for user and for
295         machine accounts). This file will be located in the <emphasis>private</emphasis>
296         directory (default is /usr/local/samba/lib/private or on linux /etc/samba).
297         </para></listitem>
298
299         <listitem><para>
300         <emphasis>smbpasswd_nua</emphasis> - This file is independant of the
301         system wide user accounts. The use of this back-end option requires
302         specification of the "non unix account range" option also. It is called
303         smbpasswd and will be located in the <filename>private</filename> directory.
304         </para></listitem>
305
306         <listitem><para>
307         <emphasis>tdbsam</emphasis> - a binary database backend that will be
308         stored in the <emphasis>private</emphasis> directory in a file called
309         <emphasis>passwd.tdb</emphasis>. The key benefit of this binary format
310         file is that it can store binary objects that can not be accomodated
311         in the traditional plain text smbpasswd file.
312         </para></listitem>
313
314         <listitem><para>
315         <emphasis>tdbsam_nua</emphasis> like the smbpasswd_nua option above, this
316         file allows the creation of arbitrary user and machine accounts without
317         requiring that account to be added to the system (/etc/passwd) file. It
318         too requires the specification of the "non unix account range" option
319         in the [globals] section of the &smb.conf; file.
320         </para></listitem>
321
322         <listitem><para>
323         <emphasis>ldapsam</emphasis> - An LDAP based back-end. Permits the
324         LDAP server to be specified. eg: ldap://localhost or ldap://frodo.murphy.com
325         </para></listitem>
326
327         <listitem><para>
328         <emphasis>ldapsam_nua</emphasis> - LDAP based back-end with no unix
329         account requirement, like smbpasswd_nua and tdbsam_nua above.
330         </para></listitem>
331 </itemizedlist>
332
333 <para>Read the chapter about the <link linkend="passdb">User Database</link> 
334 for details.</para>
335
336 <note><para>
337 The new tdbsam and ldapsam account backends store vastly more information than
338 smbpasswd is capable of. The new backend database includes capacity to specify
339 per user settings for many parameters, over-riding global settings given in the
340 <filename>smb.conf</filename> file. eg: logon drive, logon home, logon path, etc.
341 </para></note>
342
343 <para>
344 A Samba PDC, however, stores each machine trust account in two parts,
345 as follows:
346
347 <itemizedlist>
348     <listitem><para>A Samba account, stored in the same location as user
349     LanMan and NT password hashes (currently
350     <filename>smbpasswd</filename>). The Samba account 
351     possesses and uses only the NT password hash.</para></listitem>
352
353     <listitem><para>A corresponding Unix account, typically stored in
354     <filename>/etc/passwd</filename>. (Future releases will alleviate the need to
355     create <filename>/etc/passwd</filename> entries.) </para></listitem>
356 </itemizedlist>
357 </para>
358
359 <para>
360 There are two ways to create machine trust accounts:
361 </para>
362
363 <itemizedlist>
364         <listitem><para> Manual creation. Both the Samba and corresponding
365         Unix account are created by hand.</para></listitem>
366         
367         <listitem><para> "On-the-fly" creation. The Samba machine trust
368         account is automatically created by Samba at the time the client
369         is joined to the domain. (For security, this is the
370         recommended method.) The corresponding Unix account may be
371         created automatically or manually. </para>
372         </listitem>
373
374 </itemizedlist>
375
376 <sect2>
377 <title>Manual Creation of Machine Trust Accounts</title>
378
379 <para>
380 The first step in manually creating a machine trust account is to
381 manually create the corresponding Unix account in
382 <filename>/etc/passwd</filename>.  This can be done using
383 <command>vipw</command> or other 'add user' command that is normally
384 used to create new Unix accounts.  The following is an example for a
385 Linux based Samba server:
386 </para>
387
388 <para>
389   <prompt>root# </prompt><command>/usr/sbin/useradd -g 100 -d /dev/null -c <replaceable>"machine 
390 nickname"</replaceable> -s /bin/false <replaceable>machine_name</replaceable>$ </command>
391 </para>
392 <para>
393 <prompt>root# </prompt><command>passwd -l <replaceable>machine_name</replaceable>$</command>
394 </para>
395
396 <para>On *BSD systems, this can be done using the 'chpass' utility:</para>
397
398 <para>
399 <prompt>root# </prompt><command>chpass -a "<replaceable>machine_name</replaceable>$:*:101:100::0:0:Workstation <replaceable>machine_name</replaceable>:/dev/null:/sbin/nologin"</command>
400 </para>
401
402 <para>
403 The <filename>/etc/passwd</filename> entry will list the machine name 
404 with a "$" appended, won't have a password, will have a null shell and no 
405 home directory. For example a machine named 'doppy' would have an 
406 <filename>/etc/passwd</filename> entry like this:
407 </para>
408
409 <para><programlisting>
410 doppy$:x:505:501:<replaceable>machine_nickname</replaceable>:/dev/null:/bin/false
411 </programlisting></para>
412
413 <para>
414 Above, <replaceable>machine_nickname</replaceable> can be any
415 descriptive name for the client, i.e., BasementComputer.
416 <replaceable>machine_name</replaceable> absolutely must be the NetBIOS
417 name of the client to be joined to the domain.  The "$" must be
418 appended to the NetBIOS name of the client or Samba will not recognize
419 this as a machine trust account.
420 </para>
421
422
423 <para>
424 Now that the corresponding Unix account has been created, the next step is to create 
425 the Samba account for the client containing the well-known initial 
426 machine trust account password.  This can be done using the <ulink 
427 url="smbpasswd.8.html"><command>smbpasswd(8)</command></ulink> command 
428 as shown here:
429 </para>
430
431 <para>
432 <prompt>root# </prompt><userinput>smbpasswd -a -m <replaceable>machine_name</replaceable></userinput>
433 </para>
434
435 <para>
436 where <replaceable>machine_name</replaceable> is the machine's NetBIOS
437 name.  The RID of the new machine account is generated from the UID of 
438 the corresponding Unix account.
439 </para>
440
441 <warning>
442         <title>Join the client to the domain immediately</title>
443
444         <para>
445         Manually creating a machine trust account using this method is the 
446         equivalent of creating a machine trust account on a Windows NT PDC using 
447         the "Server Manager".  From the time at which the account is created
448         to the time which the client joins the domain and changes the password,
449         your domain is vulnerable to an intruder joining your domain using
450         a machine with the same NetBIOS name.  A PDC inherently trusts
451         members of the domain and will serve out a large degree of user 
452         information to such clients.  You have been warned!
453         </para>
454 </warning>
455 </sect2>
456
457
458 <sect2>
459 <title>"On-the-Fly" Creation of Machine Trust Accounts</title>
460
461 <para>
462 The second (and recommended) way of creating machine trust accounts is
463 simply to allow the Samba server to create them as needed when the client
464 is joined to the domain. </para>
465
466 <para>Since each Samba machine trust account requires a corresponding
467 Unix account, a method for automatically creating the
468 Unix account is usually supplied; this requires configuration of the
469 <ulink url="smb.conf.5.html#ADDMACHINESCRIPT">add machine script</ulink> 
470 option in <filename>smb.conf</filename>.  This
471 method is not required, however; corresponding Unix accounts may also
472 be created manually.
473 </para>
474
475
476 <para>Below is an example for a RedHat 6.2 Linux system.
477 </para>
478
479 <para><programlisting>
480 [global]
481    # &lt;...remainder of parameters...&gt;
482    add machine script = /usr/sbin/useradd -d /dev/null -g 100 -s /bin/false -M %u 
483 </programlisting></para>
484
485 </sect2>
486
487
488 <sect2><title>Joining the Client to the Domain</title>
489
490 <para>
491 The procedure for joining a client to the domain varies with the
492 version of Windows.
493 </para>
494
495 <itemizedlist>
496 <listitem><para><emphasis>Windows 2000</emphasis></para>
497
498         <para>
499         When the user elects to join the client to a domain, Windows prompts for
500         an account and password that is privileged to join the domain. A Samba administrative
501         account (i.e., a Samba account that has root privileges on the Samba server) must be
502         entered here; the operation will fail if an ordinary user account is given. 
503         The password for this account should be set to a different password than the associated
504         <filename>/etc/passwd</filename> entry, for security reasons.
505         </para>
506
507         <para>
508         The session key of the Samba administrative account acts as an
509         encryption key for setting the password of the machine trust
510         account. The machine trust account will be created on-the-fly, or
511         updated if it already exists.
512         </para>
513
514 </listitem>
515
516 <listitem><para><emphasis>Windows NT</emphasis></para>
517
518     <para> If the machine trust account was created manually, on the
519         Identification Changes menu enter the domain name, but do not
520         check the box "Create a Computer Account in the Domain."  In this case,
521         the existing machine trust account is used to join the machine to
522         the domain.</para>
523
524     <para> If the machine trust account is to be created
525         on-the-fly, on the Identification Changes menu enter the domain
526         name, and check the box "Create a Computer Account in the Domain."  In
527         this case, joining the domain proceeds as above for Windows 2000
528         (i.e., you must supply a Samba administrative account when
529         prompted).</para>
530 </listitem>
531
532 <listitem><para><emphasis>Samba</emphasis></para>
533         <para>Joining a samba client to a domain is documented in 
534         the <link linkend="domain-member">Domain Member</link> chapter.
535 </para></listitem>
536 </itemizedlist>
537
538 </sect2>
539 </sect1>
540
541 <sect1>
542 <title>Common Problems and Errors</title>
543
544 <sect2>
545 <title>I cannot include a '$' in a machine name</title>
546 <para>
547 A 'machine name' in (typically) <filename>/etc/passwd</filename>        
548 of the machine name with a '$' appended. FreeBSD (and other BSD 
549 systems?) won't create a user with a '$' in their name.
550 </para>
551
552 <para>
553 The problem is only in the program used to make the entry. Once made, it works perfectly.
554 Create a user without the '$' using <command>vipw</command> to edit the entry, adding
555 the '$'. Or create the whole entry with vipw if you like, make sure you use a unique User ID!
556 </para>
557 </sect2>
558
559 <sect2>
560 <title>I get told "You already have a connection to the Domain...." 
561 or "Cannot join domain, the credentials supplied conflict with an 
562 existing set.." when creating a machine trust account.</title>
563
564 <para>
565 This happens if you try to create a machine trust account from the 
566 machine itself and already have a connection (e.g. mapped drive) 
567 to a share (or IPC$) on the Samba PDC.  The following command
568 will remove all network drive connections:
569 </para>
570
571 <para>
572 <prompt>C:\WINNT\></prompt> <command>net use * /d</command>
573 </para>
574
575 <para>
576 Further, if the machine is already a 'member of a workgroup' that 
577 is the same name as the domain you are joining (bad idea) you will 
578 get this message.  Change the workgroup name to something else, it 
579 does not matter what, reboot, and try again.
580 </para>
581 </sect2>
582
583 <sect2>
584 <title>The system can not log you on (C000019B)....</title>
585
586 <para>I joined the domain successfully but after upgrading 
587 to a newer version of the Samba code I get the message, "The system 
588 can not log you on (C000019B), Please try again or consult your 
589 system administrator" when attempting to logon.
590 </para>
591
592 <para>
593 This occurs when the domain SID stored in the secrets.tdb database
594 is changed. The most common cause of a change in domain SID is when
595 the domain name and/or the server name (netbios name) is changed.
596 The only way to correct the problem is to restore the original domain 
597 SID or remove the domain client from the domain and rejoin. The domain
598 SID may be reset using either the net or rpcclient utilities.
599 </para>
600
601 <para>
602 The reset or change the domain SID you can use the net command as follows:
603
604 <programlisting>
605         net getlocalsid 'OLDNAME'
606         net setlocalsid 'SID'
607 </programlisting>
608 </para>
609
610 </sect2>
611
612 <sect2>
613 <title>The machine trust account for this computer either does not 
614 exist or is not accessible.</title>
615
616 <para>
617 When I try to join the domain I get the message "The machine account 
618 for this computer either does not exist or is not accessible". What's 
619 wrong?
620 </para>
621
622 <para>
623 This problem is caused by the PDC not having a suitable machine trust account. 
624 If you are using the <parameter>add machine script</parameter> method to create 
625 accounts then this would indicate that it has not worked. Ensure the domain 
626 admin user system is working.
627 </para>
628
629 <para>
630 Alternatively if you are creating account entries manually then they 
631 have not been created correctly. Make sure that you have the entry 
632 correct for the machine trust account in smbpasswd file on the Samba PDC. 
633 If you added the account using an editor rather than using the smbpasswd 
634 utility, make sure that the account name is the machine NetBIOS name 
635 with a '$' appended to it ( i.e. computer_name$ ). There must be an entry 
636 in both /etc/passwd and the smbpasswd file. Some people have reported 
637 that inconsistent subnet masks between the Samba server and the NT 
638 client have caused this problem.   Make sure that these are consistent 
639 for both client and server.
640 </para>
641 </sect2>
642
643 <sect2>
644 <title>When I attempt to login to a Samba Domain from a NT4/W2K workstation,
645 I get a message about my account being disabled.</title>
646
647 <para>
648 At first be ensure to enable the useraccounts with <command>smbpasswd -e 
649 %user%</command>, this is normally done, when you create an account.
650 </para>
651
652 </sect2>
653
654 </sect1>
655
656 <sect1>
657 <title>Domain Control for Windows 9x/ME</title>
658
659 <para>
660 A domain and a workgroup are exactly the same thing in terms of network
661 browsing.  The difference is that a distributable authentication
662 database is associated with a domain, for secure login access to a
663 network.  Also, different access rights can be granted to users if they
664 successfully authenticate against a domain logon server. Samba-3 does this
665 now in the same way that MS Windows NT/2K.
666 </para>
667
668 <para>
669 The SMB client logging on to a domain has an expectation that every other
670 server in the domain should accept the same authentication information.
671 Network browsing functionality of domains and workgroups is identical and
672 is explained in this documentation under the browsing discussions.
673 It should be noted, that browsing is totally orthogonal to logon support.
674 </para>
675
676 <para>
677 Issues related to the single-logon network model are discussed in this
678 section.  Samba supports domain logons, network logon scripts, and user
679 profiles for MS Windows for workgroups and MS Windows 9X/ME clients
680 which are the focus of this section.
681 </para>
682
683
684 <para>
685 When an SMB client in a domain wishes to logon it broadcast requests for a
686 logon server.  The first one to reply gets the job, and validates its
687 password using whatever mechanism the Samba administrator has installed.
688 It is possible (but very stupid) to create a domain where the user
689 database is not shared between servers, i.e. they are effectively workgroup
690 servers advertising themselves as participating in a domain.  This
691 demonstrates how authentication is quite different from but closely
692 involved with domains.
693 </para>
694
695
696 <para>
697 Using these features you can make your clients verify their logon via
698 the Samba server; make clients run a batch file when they logon to
699 the network and download their preferences, desktop and start menu.
700 </para>
701
702 <para>
703 Before launching into the configuration instructions, it is 
704 worthwhile to look at how a Windows 9x/ME client performs a logon:
705 </para>
706
707 <orderedlist>
708 <listitem>
709         <para>
710         The client broadcasts (to the IP broadcast address of the subnet it is in)
711         a NetLogon request. This is sent to the NetBIOS name DOMAIN&lt;1c&gt; at the
712         NetBIOS layer.  The client chooses the first response it receives, which
713         contains the NetBIOS name of the logon server to use in the format of 
714         \\SERVER.
715         </para>
716 </listitem>
717
718 <listitem>
719         <para>
720         The client then connects to that server, logs on (does an SMBsessetupX) and
721         then connects to the IPC$ share (using an SMBtconX).
722         </para>
723 </listitem>
724
725 <listitem>
726         <para>
727         The client then does a NetWkstaUserLogon request, which retrieves the name
728         of the user's logon script. 
729         </para>
730 </listitem>
731
732 <listitem>
733         <para>
734         The client then connects to the NetLogon share and searches for this    
735         and if it is found and can be read, is retrieved and executed by the client.
736         After this, the client disconnects from the NetLogon share.
737         </para>
738 </listitem>
739
740 <listitem>
741         <para>
742         The client then sends a NetUserGetInfo request to the server, to retrieve
743         the user's home share, which is used to search for profiles. Since the
744         response to the NetUserGetInfo request does not contain much more then  
745         the user's home share, profiles for Win9X clients MUST reside in the user
746         home directory.
747         </para>
748 </listitem>
749
750 <listitem>
751         <para>
752         The client then connects to the user's home share and searches for the 
753         user's profile. As it turns out, you can specify the user's home share as
754         a sharename and path. For example, \\server\fred\.profile.
755         If the profiles are found, they are implemented.
756         </para>
757 </listitem>
758
759 <listitem>
760         <para>
761         The client then disconnects from the user's home share, and reconnects to
762         the NetLogon share and looks for CONFIG.POL, the policies file. If this is
763         found, it is read and implemented.
764         </para>
765 </listitem>
766 </orderedlist>
767
768
769 <sect2>
770 <title>Configuration Instructions:      Network Logons</title>
771
772 <para>
773 The main difference between a PDC and a Windows 9x logon 
774 server configuration is that
775 </para>
776
777 <itemizedlist>
778
779 <listitem><para>
780 Password encryption is not required for a Windows 9x logon server.
781 </para></listitem>
782
783 <listitem><para>
784 Windows 9x/ME clients do not possess machine trust accounts.
785 </para></listitem>
786
787 </itemizedlist>
788
789 <para>
790 Therefore, a Samba PDC will also act as a Windows 9x logon 
791 server.
792 </para>
793
794
795 <warning>
796 <title>security mode and master browsers</title>
797
798 <para>
799 There are a few comments to make in order to tie up some 
800 loose ends.  There has been much debate over the issue of whether
801 or not it is ok to configure Samba as a Domain Controller in security
802 modes other than <constant>USER</constant>.  The only security mode 
803 which  will not work due to technical reasons is <constant>SHARE</constant>
804 mode security.  <constant>DOMAIN</constant> and <constant>SERVER</constant>
805 mode security is really just a variation on SMB user level security.
806 </para>
807
808 <para>
809 Actually, this issue is also closely tied to the debate on whether 
810 or not Samba must be the domain master browser for its workgroup
811 when operating as a DC.  While it may technically be possible
812 to configure a server as such (after all, browsing and domain logons
813 are two distinctly different functions), it is not a good idea to do
814 so.  You should remember that the DC must register the DOMAIN#1b NetBIOS 
815 name.  This is the name used by Windows clients to locate the DC.
816 Windows clients do not distinguish between the DC and the DMB.
817 For this reason, it is very wise to configure the Samba DC as the DMB.
818 </para>
819
820 <para>
821 Now back to the issue of configuring a Samba DC to use a mode other
822 than "security = user".  If a Samba host is configured to use 
823 another SMB server or DC in order to validate user connection 
824 requests, then it is a fact that some other machine on the network 
825 (the "password server") knows more about the user than the Samba host.
826 99% of the time, this other host is a domain controller.  Now 
827 in order to operate in domain mode security, the "workgroup" parameter
828 must be set to the name of the Windows NT domain (which already 
829 has a domain controller, right?)
830 </para>
831
832 <para>
833 Therefore configuring a Samba box as a DC for a domain that 
834 already by definition has a PDC is asking for trouble.
835 Therefore, you should always configure the Samba DC to be the DMB
836 for its domain.
837 </para>
838 </warning>
839
840 </sect2>
841 </sect1>
842 </chapter>