Split "clobber" function and variables into its own file before it
[jra/samba/.git] / docs / docbook / projdoc / Samba-PDC-HOWTO.sgml
1 <chapter id="samba-pdc">
2
3
4 <chapterinfo>
5         <author>
6                 <firstname>Gerald (Jerry)</firstname><surname>Carter</surname>
7                 <affiliation>
8                         <orgname>VA Linux Systems/Samba Team</orgname>
9                         <address><email>jerry@samba.org</email></address>
10                 </affiliation>
11                 <firstname>David</firstname><surname>Bannon</surname>
12                 <affiliation>
13                         <orgname>Samba Team</orgname>
14                         <address><email>dbannon@samba.org</email></address>
15                 </affiliation>
16                 
17         </author>
18         <pubdate> (26 Apr 2001) </pubdate>
19 </chapterinfo>
20
21 <title>
22 Samba as a NT4 or Win2k Primary Domain Controller
23 </title>
24
25
26 <!-- **********************************************************
27
28      Prerequisite Reading
29
30 *************************************************************** -->
31 <sect1>
32 <title>Prerequisite Reading</title>
33
34 <para>
35 Before you continue reading in this chapter, please make sure 
36 that you are comfortable with configuring basic files services
37 in smb.conf and how to enable and administer password 
38 encryption in Samba.  Theses two topics are covered in the
39 <ulink url="smb.conf.5.html"><filename>smb.conf(5)</filename></ulink> 
40 manpage and the <ulink url="ENCRYPTION.html">Encryption chapter</ulink> 
41 of this HOWTO Collection.
42 </para>
43
44
45 </sect1>
46
47
48
49 <!-- **********************************************************
50
51      Background Information
52
53 *************************************************************** -->
54 <sect1>
55 <title>
56 Background
57 </title>
58
59 <note>
60 <para>
61 <emphasis>Author's Note:</emphasis> This document is a combination 
62 of David Bannon's "Samba 2.2 PDC HOWTO" and "Samba NT Domain FAQ". 
63 Both documents are superseded by this one.
64 </para>
65 </note>
66
67 <para>
68 Versions of Samba prior to release 2.2 had marginal capabilities to act
69 as a Windows NT 4.0 Primary Domain Controller
70 <indexterm><primary>Primary Domain Controller</primary></indexterm>
71 (PDC).  With Samba 2.2.0, we are proud to announce official support for
72 Windows NT 4.0-style domain logons from Windows NT 4.0 and Windows 
73 2000 clients.  This article outlines the steps
74 necessary for configuring Samba as a PDC.  It is necessary to have a
75 working Samba server prior to implementing the PDC functionality.  If
76 you have not followed the steps outlined in <ulink
77 url="UNIX_INSTALL.html"> UNIX_INSTALL.html</ulink>, please make sure
78 that your server is configured correctly before proceeding.  Another
79 good resource in the <ulink url="smb.conf.5.html">smb.conf(5) man
80 page</ulink>. The following functionality should work in 2.2:
81 </para>
82
83 <itemizedlist>
84         <listitem><para>
85         domain logons for Windows NT 4.0/2000 clients.
86         </para></listitem>
87         
88         <listitem><para>
89         placing a Windows 9x client in user level security
90         </para></listitem>
91         
92         <listitem><para>
93         retrieving a list of users and groups from a Samba PDC to
94         Windows 9x/NT/2000 clients
95         </para></listitem>
96         
97         <listitem><para>
98         roving (roaming) user profiles
99         </para></listitem>
100         
101         <listitem><para>
102         Windows NT 4.0-style system policies
103         </para></listitem>
104 </itemizedlist>
105
106
107 <para>
108 The following pieces of functionality are not included in the 2.2 release:
109 </para>
110
111 <itemizedlist>
112         <listitem><para>
113         Windows NT 4 domain trusts
114         </para></listitem>
115         
116         <listitem><para>
117         SAM replication with Windows NT 4.0 Domain Controllers
118         (i.e. a Samba PDC and a Windows NT BDC or vice versa) 
119         </para></listitem>
120         
121         <listitem><para>
122         Adding users via the User Manager for Domains
123         </para></listitem>
124
125         <listitem><para>
126         Acting as a Windows 2000 Domain Controller (i.e. Kerberos and 
127         Active Directory)
128         </para></listitem>
129 </itemizedlist>
130
131 <para>
132 Please note that Windows 9x clients are not true members of a domain
133 for reasons outlined in this article.  Therefore the protocol for
134 support Windows 9x-style domain logons is completely different
135 from NT4 domain logons and has been officially supported for some 
136 time.
137 </para>
138
139
140 <para>
141 Implementing a Samba PDC can basically be divided into 2 broad
142 steps.
143 </para>
144
145 <orderedlist numeration="arabic">
146         <listitem><para>
147         Configuring the Samba PDC
148         </para></listitem>
149         
150         <listitem><para>
151         Creating machine trust accounts and joining clients 
152         to the domain
153         </para></listitem>
154 </orderedlist>
155
156 <para>
157 There are other minor details such as user profiles, system
158 policies, etc...  However, these are not necessarily specific
159 to a Samba PDC as much as they are related to Windows NT networking
160 concepts.  They will be mentioned only briefly here.
161 </para>
162
163 </sect1>
164
165
166 <!-- **********************************************************
167
168      Configuring the Samba PDC
169
170 *************************************************************** -->
171
172 <sect1>
173 <title>Configuring the Samba Domain Controller</title>
174
175 <para>
176 The first step in creating a working Samba PDC is to 
177 understand the parameters necessary in smb.conf.  I will not
178 attempt to re-explain the parameters here as they are more that
179 adequately covered in <ulink url="smb.conf.5.html"> the smb.conf
180 man page</ulink>.  For convenience, the parameters have been
181 linked with the actual smb.conf description.
182 </para>
183
184 <para>
185 Here is an example <filename>smb.conf</filename> for acting as a PDC:
186 </para>
187
188 <para><programlisting>
189 [global]
190     ; Basic server settings
191     <ulink url="smb.conf.5.html#NETBIOSNAME">netbios name</ulink> = <replaceable>POGO</replaceable>
192     <ulink url="smb.conf.5.html#WORKGROUP">workgroup</ulink> = <replaceable>NARNIA</replaceable>
193
194     ; we should act as the domain and local master browser
195     <ulink url="smb.conf.5.html#OSLEVEL">os level</ulink> = 64
196     <ulink url="smb.conf.5.html#PERFERREDMASTER">preferred master</ulink> = yes
197     <ulink url="smb.conf.5.html#DOMAINMASTER">domain master</ulink> = yes
198     <ulink url="smb.conf.5.html#LOCALMASTER">local master</ulink> = yes
199     
200     ; security settings (must user security = user)
201     <ulink url="smb.conf.5.html#SECURITYEQUALSUSER">security</ulink> = user
202     
203     ; encrypted passwords are a requirement for a PDC
204     <ulink url="smb.conf.5.html#ENCRYPTPASSWORDS">encrypt passwords</ulink> = yes
205     
206     ; support domain logons
207     <ulink url="smb.conf.5.html#DOMAINLOGONS">domain logons</ulink> = yes
208     
209     ; where to store user profiles?
210     <ulink url="smb.conf.5.html#LOGONPATH">logon path</ulink> = \\%N\profiles\%u
211     
212     ; where is a user's home directory and where should it
213     ; be mounted at?
214     <ulink url="smb.conf.5.html#LOGONDRIVE">logon drive</ulink> = H:
215     <ulink url="smb.conf.5.html#LOGONHOME">logon home</ulink> = \\homeserver\%u
216     
217     ; specify a generic logon script for all users
218     ; this is a relative **DOS** path to the [netlogon] share
219     <ulink url="smb.conf.5.html#LOGONSCRIPT">logon script</ulink> = logon.cmd
220
221 ; necessary share for domain controller
222 [netlogon]
223     <ulink url="smb.conf.5.html#PATH">path</ulink> = /usr/local/samba/lib/netlogon
224     <ulink url="smb.conf.5.html#READONLY">read only</ulink> = yes
225     <ulink url="smb.conf.5.html#WRITELIST">write list</ulink> = <replaceable>ntadmin</replaceable>
226     
227 ; share for storing user profiles
228 [profiles]
229     <ulink url="smb.conf.5.html#PATH">path</ulink> = /export/smb/ntprofile
230     <ulink url="smb.conf.5.html#READONLY">read only</ulink> = no
231     <ulink url="smb.conf.5.html#CREATEMASK">create mask</ulink> = 0600
232     <ulink url="smb.conf.5.html#DIRECTORYMASK">directory mask</ulink> = 0700
233 </programlisting></para>
234
235 <para>
236 There are a couple of points to emphasize in the above configuration.
237 </para>
238
239 <itemizedlist>
240         <listitem><para>
241         Encrypted passwords must be enabled.  For more details on how 
242         to do this, refer to <ulink url="ENCRYPTION.html">ENCRYPTION.html</ulink>.
243         </para></listitem>
244         
245         <listitem><para>
246         The server must support domain logons and a
247         <filename>[netlogon]</filename> share
248         </para></listitem>
249         
250         <listitem><para>
251         The server must be the domain master browser in order for Windows 
252         client to locate the server as a DC.  Please refer to the various 
253         Network Browsing documentation included with this distribution for 
254         details.
255         </para></listitem>
256 </itemizedlist>    
257
258 <para>
259 As Samba 2.2 does not offer a complete implementation of group mapping
260 between Windows NT groups and Unix groups (this is really quite
261 complicated to explain in a short space), you should refer to the
262 <ulink url="smb.conf.5.html#DOMAINADMINGROUP">domain admin
263 group</ulink> smb.conf parameter for information of creating "Domain
264 Admins" style accounts.
265 </para>
266
267 </sect1>
268
269
270 <sect1>
271 <title>Creating Machine Trust Accounts and Joining Clients to the
272 Domain</title>
273
274 <para>
275 A machine trust account is a Samba account that is used to
276 authenticate a client machine (rather than a user) to the Samba
277 server.  In Windows terminology, this is known as a "Computer
278 Account."</para>
279
280 <para>
281 The password of a machine trust account acts as the shared secret for
282 secure communication with the Domain Controller.  This is a security
283 feature to prevent an unauthorized machine with the same NetBIOS name
284 from joining the domain and gaining access to domain user/group
285 accounts.  Windows NT and 2000 clients use machine trust accounts, but
286 Windows 9x clients do not.  Hence, a Windows 9x client is never a true
287 member of a domain because it does not possess a machine trust
288 account, and thus has no shared secret with the domain controller.
289 </para>
290
291 <para>A Windows PDC stores each machine trust account in the Windows
292 Registry.  A Samba PDC, however, stores each machine trust account 
293 in two parts, as follows:
294
295 <itemizedlist>
296     <listitem><para>A Samba account, stored in the same location as user
297     LanMan and NT password hashes (currently
298     <filename>smbpasswd</filename>). The Samba account 
299     possesses and uses only the NT password hash.</para></listitem>
300
301     <listitem><para>A corresponding Unix account, typically stored in
302     <filename>/etc/passwd</filename>. (Future releases will alleviate the need to
303     create <filename>/etc/passwd</filename> entries.) </para></listitem>
304 </itemizedlist>
305 </para>
306
307 <para>
308 There are two ways to create machine trust accounts:
309 </para>
310
311 <itemizedlist>
312         <listitem><para> Manual creation. Both the Samba and corresponding
313         Unix account are created by hand.</para></listitem>
314         
315         <listitem><para> "On-the-fly" creation. The Samba machine trust
316         account is automatically created by Samba at the time the client
317         is joined to the domain. (For security, this is the
318         recommended method.) The corresponding Unix account may be
319         created automatically or manually. </para>
320         </listitem>
321
322 </itemizedlist>
323
324 <sect2>
325 <title>Manual Creation of Machine Trust Accounts</title>
326
327 <para>
328 The first step in manually creating a machine trust account is to
329 manually create the corresponding Unix account in
330 <filename>/etc/passwd</filename>.  This can be done using
331 <command>vipw</command> or other 'add user' command that is normally
332 used to create new Unix accounts.  The following is an example for a
333 Linux based Samba server:
334 </para>
335
336 <para>
337   <prompt>root# </prompt><command>/usr/sbin/useradd -g 100 -d /dev/null -c <replaceable>"machine 
338 nickname"</replaceable> -s /bin/false <replaceable>machine_name</replaceable>$ </command>
339 </para>
340 <para>
341 <prompt>root# </prompt><command>passwd -l <replaceable>machine_name</replaceable>$</command>
342 </para>
343
344 <para>On *BSD systems, this can be done using the 'chpass' utility:</para>
345
346 <para>
347 <prompt>root# </prompt><command>chpass -a "<replaceable>machine_name</replaceable>$:*:101:100::0:0:Workstation <replaceable>machine_name</replaceable>:/dev/null:/sbin/nologin"</command>
348 </para>
349
350 <para>
351 The <filename>/etc/passwd</filename> entry will list the machine name 
352 with a "$" appended, won't have a password, will have a null shell and no 
353 home directory. For example a machine named 'doppy' would have an 
354 <filename>/etc/passwd</filename> entry like this:
355 </para>
356
357 <para><programlisting>
358 doppy$:x:505:501:<replaceable>machine_nickname</replaceable>:/dev/null:/bin/false
359 </programlisting></para>
360
361 <para>
362 Above, <replaceable>machine_nickname</replaceable> can be any
363 descriptive name for the client, i.e., BasementComputer.
364 <replaceable>machine_name</replaceable> absolutely must be the NetBIOS
365 name of the client to be joined to the domain.  The "$" must be
366 appended to the NetBIOS name of the client or Samba will not recognize
367 this as a machine trust account.
368 </para>
369
370
371 <para>
372 Now that the corresponding Unix account has been created, the next step is to create 
373 the Samba account for the client containing the well-known initial 
374 machine trust account password.  This can be done using the <ulink 
375 url="smbpasswd.8.html"><command>smbpasswd(8)</command></ulink> command 
376 as shown here:
377 </para>
378
379 <para>
380 <prompt>root# </prompt><command>smbpasswd -a -m <replaceable>machine_name</replaceable></command>
381 </para>
382
383 <para>
384 where <replaceable>machine_name</replaceable> is the machine's NetBIOS
385 name.  The RID of the new machine account is generated from the UID of 
386 the corresponding Unix account.
387 </para>
388
389 <warning>
390         <title>Join the client to the domain immediately</title>
391
392         <para>
393         Manually creating a machine trust account using this method is the 
394         equivalent of creating a machine trust account on a Windows NT PDC using 
395         the "Server Manager".  From the time at which the account is created
396         to the time which the client joins the domain and changes the password,
397         your domain is vulnerable to an intruder joining your domain using a
398         a machine with the same NetBIOS name.  A PDC inherently trusts
399         members of the domain and will serve out a large degree of user 
400         information to such clients.  You have been warned!
401         </para>
402 </warning>
403 </sect2>
404
405
406 <sect2>
407 <title>"On-the-Fly" Creation of Machine Trust Accounts</title>
408
409 <para>
410 The second (and recommended) way of creating machine trust accounts is
411 simply to allow the Samba server to create them as needed when the client
412 is joined to the domain. </para>
413
414 <para>Since each Samba machine trust account requires a corresponding
415 Unix account, a method for automatically creating the
416 Unix account is usually supplied; this requires configuration of the
417 <ulink url="smb.conf.5.html#ADDUSERSCRIPT">add user script</ulink> 
418 option in <filename>smb.conf</filename>.  This
419 method is not required, however; corresponding Unix accounts may also
420 be created manually.
421 </para>
422
423
424 <para>Below is an example for a RedHat 6.2 Linux system.
425 </para>
426
427 <para><programlisting>
428 [global]
429    # &lt;...remainder of parameters...&gt;
430    add user script = /usr/sbin/useradd -d /dev/null -g 100 -s /bin/false -M %u 
431 </programlisting></para>
432
433 </sect2>
434
435
436 <sect2><title>Joining the Client to the Domain</title>
437
438 <para>
439 The procedure for joining a client to the domain varies with the
440 version of Windows.
441 </para>
442
443 <itemizedlist>
444 <listitem><para><emphasis>Windows 2000</emphasis></para>
445
446         <para> When the user elects to join the client to a domain, Windows prompts for
447         an account and password that is privileged to join the domain.  A
448         Samba administrative account (i.e., a Samba account that has root
449         privileges on the Samba server) must be entered here; the
450         operation will fail if an ordinary user account is given. 
451         The password for this account should be
452         set to a different password than the associated
453         <filename>/etc/passwd</filename> entry, for security
454         reasons. </para>
455
456         <para>The session key of the Samba administrative account acts as an
457         encryption key for setting the password of the machine trust
458         account. The machine trust account will be created on-the-fly, or
459         updated if it already exists.</para>
460 </listitem>
461
462 <listitem><para><emphasis>Windows NT</emphasis></para>
463
464     <para> If the machine trust account was created manually, on the
465         Identification Changes menu enter the domain name, but do not
466         check the box "Create a Computer Account in the Domain."  In this case,
467         the existing machine trust account is used to join the machine to
468         the domain.</para>
469
470     <para> If the machine trust account is to be created
471         on-the-fly, on the Identification Changes menu enter the domain
472         name, and check the box "Create a Computer Account in the Domain."  In
473         this case, joining the domain proceeds as above for Windows 2000
474         (i.e., you must supply a Samba administrative account when
475         prompted).</para>
476 </listitem>
477 </itemizedlist>
478
479 </sect2>
480 </sect1>
481 <!-- **********************************************************
482
483      Common Problems
484
485 *************************************************************** -->
486
487 <sect1>
488 <title>Common Problems and Errors</title>
489
490 <para>
491 </para>
492 <itemizedlist>
493 <listitem>
494         <para>
495         <emphasis>I cannot include a '$' in a machine name.</emphasis>
496         </para>
497     
498         <para>
499         A 'machine name' in (typically) <filename>/etc/passwd</filename>        
500         of the machine name with a '$' appended. FreeBSD (and other BSD 
501         systems?) won't create a user with a '$' in their name.
502         </para>
503
504         <para>
505         The problem is only in the program used to make the entry, once 
506         made, it works perfectly. So create a user without the '$' and 
507         use <command>vipw</command> to edit the entry, adding the '$'. Or create 
508         the whole entry with vipw if you like, make sure you use a 
509         unique User ID !
510         </para>
511 </listitem>
512   
513 <listitem>
514         <para>
515         <emphasis>I get told "You already have a connection to the Domain...." 
516         or "Cannot join domain, the credentials supplied conflict with an 
517         existing set.." when creating a machine trust account.</emphasis>
518         </para>
519
520         <para>
521         This happens if you try to create a machine trust account from the 
522         machine itself and already have a connection (e.g. mapped drive) 
523         to a share (or IPC$) on the Samba PDC.  The following command
524         will remove all network drive connections:
525         </para>
526
527         <para>
528         <prompt>C:\WINNT\></prompt> <command>net use * /d</command>
529         </para>
530
531         <para>
532         Further, if the machine is a already a 'member of a workgroup' that 
533         is the same name as the domain you are joining (bad idea) you will 
534         get this message.  Change the workgroup name to something else, it 
535         does not matter what, reboot, and try again.
536         </para>
537 </listitem>
538
539 <listitem>
540         <para>
541         <emphasis>The system can not log you on (C000019B)....</emphasis>
542         </para>
543
544         <para>I joined the domain successfully but after upgrading 
545         to a newer version of the Samba code I get the message, "The system 
546         can not log you on (C000019B), Please try a gain or consult your 
547         system administrator" when attempting to logon.
548         </para>
549
550         <para>
551         This occurs when the domain SID stored in 
552         <filename>private/WORKGROUP.SID</filename> is 
553         changed.  For example, you remove the file and <command>smbd</command> automatically 
554         creates a new one.  Or you are swapping back and forth between 
555         versions 2.0.7, TNG and the HEAD branch code (not recommended).  The 
556         only way to correct the problem is to restore the original domain 
557         SID or remove the domain client from the domain and rejoin.
558         </para>
559 </listitem>
560
561 <listitem>
562         <para>
563         <emphasis>The machine trust account for this computer either does not 
564         exist or is not accessible.</emphasis>
565         </para>
566
567         <para>
568         When I try to join the domain I get the message "The machine account 
569         for this computer either does not exist or is not accessible". What's 
570         wrong?
571         </para>
572
573         <para>
574         This problem is caused by the PDC not having a suitable machine trust account. 
575         If you are using the <parameter>add user script</parameter> method to create 
576         accounts then this would indicate that it has not worked. Ensure the domain 
577         admin user system is working.
578         </para>
579
580         <para>
581         Alternatively if you are creating account entries manually then they 
582         have not been created correctly. Make sure that you have the entry 
583         correct for the machine trust account in smbpasswd file on the Samba PDC. 
584         If you added the account using an editor rather than using the smbpasswd 
585         utility, make sure that the account name is the machine NetBIOS name 
586         with a '$' appended to it ( i.e. computer_name$ ). There must be an entry 
587         in both /etc/passwd and the smbpasswd file. Some people have reported 
588         that inconsistent subnet masks between the Samba server and the NT 
589         client have caused this problem.   Make sure that these are consistent 
590         for both client and server.
591         </para>
592 </listitem>
593
594 <listitem>
595         <para>
596         <emphasis>When I attempt to login to a Samba Domain from a NT4/W2K workstation,
597         I get a message about my account being disabled.</emphasis>
598         </para>
599
600         <para>
601         This problem is caused by a PAM related bug in Samba 2.2.0.  This bug is 
602         fixed in 2.2.1.  Other symptoms could be unaccessible shares on 
603         NT/W2K member servers in the domain or the following error in your smbd.log:
604         passdb/pampass.c:pam_account(268) PAM: UNKNOWN ERROR for User: %user%
605         </para>
606  
607         <para>
608         At first be ensure to enable the useraccounts with <command>smbpasswd -e 
609         %user%</command>, this is normally done, when you create an account.
610         </para>
611
612         <para>
613         In order to work around this problem in 2.2.0, configure the 
614         <parameter>account</parameter> control flag in 
615         <filename>/etc/pam.d/samba</filename> file as follows:
616         </para> 
617
618         <para><programlisting>
619         account required        pam_permit.so
620         </programlisting></para>
621
622         <para>
623         If you want to remain backward compatibility to samba 2.0.x use
624         <filename>pam_permit.so</filename>, it's also possible to use 
625         <filename>pam_pwdb.so</filename>. There are some bugs if you try to 
626         use <filename>pam_unix.so</filename>, if you need this, be ensure to use
627         the most recent version of this file.
628         </para>
629 </listitem>
630 </itemizedlist>
631
632 </sect1>
633
634
635
636 <!-- **********************************************************
637
638      Policies and Profiles
639
640 *************************************************************** -->
641
642 <sect1>
643 <title>
644 System Policies and Profiles
645 </title>
646
647 <para>
648 Much of the information necessary to implement System Policies and
649 Roving User Profiles in a Samba domain is the same as that for 
650 implementing these same items in a Windows NT 4.0 domain. 
651 You should read the white paper <ulink url="http://www.microsoft.com/ntserver/management/deployment/planguide/prof_policies.asp">Implementing
652 Profiles and Policies in Windows NT 4.0</ulink> available from Microsoft.
653 </para>
654
655 <para>
656 Here are some additional details:
657 </para>
658
659 <itemizedlist>
660
661 <listitem>
662         <para>
663         <emphasis>What about Windows NT Policy Editor?</emphasis>
664         </para>
665
666         <para>
667         To create or edit <filename>ntconfig.pol</filename> you must use 
668         the NT Server Policy Editor, <command>poledit.exe</command>     which 
669         is included with NT Server but <emphasis>not NT Workstation</emphasis>. 
670         There is a Policy Editor on a NTws 
671         but it is not suitable for creating <emphasis>Domain Policies</emphasis>. 
672         Further, although the Windows 95 
673         Policy Editor can be installed on an NT Workstation/Server, it will not
674         work with NT policies because the registry key that are set by the policy templates. 
675         However, the files from the NT Server will run happily enough on an NTws.       
676         You need <filename>poledit.exe, common.adm</filename> and <filename>winnt.adm</filename>. It is convenient
677         to put the two *.adm files in <filename>c:\winnt\inf</filename> which is where
678         the binary will look for them unless told otherwise. Note also that that 
679         directory is 'hidden'.
680         </para>
681
682         <para>
683         The Windows NT policy editor is also included with the Service Pack 3 (and 
684         later) for Windows NT 4.0. Extract the files using <command>servicepackname /x</command>, 
685         i.e. that's <command>Nt4sp6ai.exe /x</command> for service pack 6a.  The policy editor, 
686         <command>poledit.exe</command> and the associated template files (*.adm) should
687         be extracted as well.  It is also possible to downloaded the policy template 
688         files for Office97 and get a copy of the policy editor.  Another possible 
689         location is with the Zero Administration Kit available for download from Microsoft.
690         </para>
691 </listitem>
692
693
694 <listitem>
695         <para>
696         <emphasis>Can Win95 do Policies?</emphasis>
697         </para>
698
699         <para>
700         Install the group policy handler for Win9x to pick up group 
701         policies.   Look on the Win98 CD in <filename>\tools\reskit\netadmin\poledit</filename>. 
702         Install group policies on a Win9x client by double-clicking 
703         <filename>grouppol.inf</filename>. Log off and on again a couple of 
704         times and see if Win98 picks up group policies.  Unfortunately this needs 
705         to be done on every Win9x machine that uses group policies....
706         </para> 
707
708         <para>
709         If group policies don't work one reports suggests getting the updated 
710         (read: working) grouppol.dll for Windows 9x. The group list is grabbed 
711         from /etc/group.
712         </para>
713 </listitem>
714
715
716 <listitem>
717         <para>
718         <emphasis>How do I get 'User Manager' and 'Server Manager'</emphasis>
719         </para>
720
721         <para>
722         Since I don't need to buy an NT Server CD now, how do I get 
723         the 'User Manager for Domains', the 'Server Manager'?
724         </para>
725
726         <para>
727         Microsoft distributes a version of these tools called nexus for 
728         installation on Windows 95 systems.  The tools set includes
729         </para>
730         
731         <itemizedlist>
732                 <listitem><para>Server Manager</para></listitem> 
733                 
734                 <listitem><para>User Manager for Domains</para></listitem> 
735
736                 <listitem><para>Event Viewer</para></listitem> 
737         </itemizedlist>
738
739         <para>
740         Click here to download the archived file <ulink 
741         url="ftp://ftp.microsoft.com/Softlib/MSLFILES/NEXUS.EXE">ftp://ftp.microsoft.com/Softlib/MSLFILES/NEXUS.EXE</ulink>
742         </para>
743
744         <para>
745         The Windows NT 4.0 version of the 'User Manager for 
746         Domains' and 'Server Manager' are available from Microsoft via ftp 
747         from <ulink url="ftp://ftp.microsoft.com/Softlib/MSLFILES/SRVTOOLS.EXE">ftp://ftp.microsoft.com/Softlib/MSLFILES/SRVTOOLS.EXE</ulink>
748         </para>
749 </listitem>
750 </itemizedlist>
751
752 </sect1>
753
754
755
756 <!-- **********************************************************
757
758      Getting Help
759
760 *************************************************************** -->
761
762
763 <sect1>
764 <title>What other help can I get? </title>
765
766 <para>
767 There are many sources of information available in the form 
768 of mailing lists, RFC's and documentation.  The docs that come 
769 with the samba distribution contain very good explanations of 
770 general SMB topics such as browsing.</para> 
771
772 <itemizedlist>
773 <listitem>
774         <para>
775         <emphasis>What are some diagnostics tools I can use to debug the domain logon 
776         process and where can I find them?</emphasis>
777         </para>
778
779    <para>
780         One of the best diagnostic tools for debugging problems is Samba itself.  
781         You can use the -d option for both smbd and nmbd to specify what 
782         'debug level' at which to run.  See the man pages on smbd, nmbd  and 
783         smb.conf for more information on debugging options.  The debug 
784         level can range from 1 (the default) to 10 (100 for debugging passwords).
785         </para>
786         
787         <para>
788         Another helpful method of debugging is to compile samba using the 
789         <command>gcc -g </command> flag.   This will include debug 
790         information in the binaries and allow you to attach gdb to the 
791         running smbd / nmbd process.  In order to attach gdb to an smbd 
792         process for an NT workstation, first get the workstation to make the 
793         connection. Pressing ctrl-alt-delete and going down to the domain box 
794         is sufficient (at least, on the first time you join the domain) to 
795         generate a 'LsaEnumTrustedDomains'. Thereafter, the workstation 
796         maintains an open connection, and therefore there will be an smbd 
797         process running (assuming that you haven't set a really short smbd 
798         idle timeout)  So, in between pressing ctrl alt delete, and actually 
799         typing in your password, you can gdb attach and continue.
800         </para>
801
802         <para>
803         Some useful samba commands worth investigating:
804         </para>
805         
806         <itemizedlist>
807                 <listitem><para>testparam | more</para></listitem>
808                 <listitem><para>smbclient -L //{netbios name of server}</para></listitem>
809         </itemizedlist>
810     
811         <para>
812         An SMB enabled version of tcpdump is available from 
813         <ulink url="http://www.tcpdump.org/">http://www.tcpdup.org/</ulink>.
814         Ethereal, another good packet sniffer for Unix and Win32
815         hosts, can be downloaded from <ulink 
816         url="http://www.ethereal.com/">http://www.ethereal.com</ulink>.
817         </para>
818         
819         <para>
820         For tracing things on the Microsoft Windows NT, Network Monitor 
821         (aka. netmon) is available on the Microsoft Developer Network CD's, 
822         the Windows NT Server install CD and the SMS CD's.  The version of 
823         netmon that ships with SMS allows for dumping packets between any two 
824         computers (i.e. placing the network interface in promiscuous mode).  
825         The version on the NT Server install CD will only allow monitoring 
826         of network traffic directed to the local NT box and broadcasts on the 
827         local subnet.  Be aware that Ethereal can read and write netmon 
828         formatted files.
829         </para>
830 </listitem>
831
832
833 <listitem>
834         <para>
835         <emphasis>How do I install 'Network Monitor' on an NT Workstation 
836         or a Windows 9x box?</emphasis>
837         </para>
838
839         <para>
840         Installing netmon on an NT workstation requires a couple 
841         of steps.  The following are for installing Netmon V4.00.349, which comes 
842         with Microsoft Windows NT Server 4.0, on Microsoft Windows NT 
843         Workstation 4.0.  The process should be similar for other version of 
844         Windows NT / Netmon.  You will need both the Microsoft Windows 
845         NT Server 4.0 Install CD and the Workstation 4.0 Install CD.
846         </para> 
847
848         <para>
849         Initially you will need to install 'Network Monitor Tools and Agent' 
850         on the NT Server.  To do this 
851         </para>
852
853         <itemizedlist>
854                 <listitem><para>Goto Start - Settings - Control Panel - 
855                 Network - Services - Add </para></listitem>
856                 
857                 <listitem><para>Select the 'Network Monitor Tools and Agent' and 
858                 click on 'OK'.</para></listitem> 
859                 
860                 <listitem><para>Click 'OK' on the Network Control Panel.
861                 </para></listitem> 
862                 
863                 <listitem><para>Insert the Windows NT Server 4.0 install CD 
864                 when prompted.</para></listitem> 
865         </itemizedlist>
866
867         <para>
868         At this point the Netmon files should exist in 
869         <filename>%SYSTEMROOT%\System32\netmon\*.*</filename>.    
870         Two subdirectories exist as well, <filename>parsers\</filename> 
871         which contains the necessary DLL's for parsing the netmon packet 
872         dump, and <filename>captures\</filename>.
873         </para>
874
875         <para>
876         In order to install the Netmon tools on an NT Workstation, you will 
877         first need to install the 'Network  Monitor Agent' from the Workstation 
878         install CD.
879         </para>
880
881         <itemizedlist>
882                 <listitem><para>Goto Start - Settings - Control Panel - 
883                 Network - Services - Add</para></listitem> 
884
885                 <listitem><para>Select the 'Network Monitor Agent' and click 
886                 on 'OK'.</para></listitem> 
887                 
888                 <listitem><para>Click 'OK' on the Network Control Panel.
889                 </para></listitem> 
890                 
891                 <listitem><para>Insert the Windows NT Workstation 4.0 install 
892                 CD when prompted.</para></listitem> 
893         </itemizedlist>
894
895
896         <para>
897         Now copy the files from the NT Server in %SYSTEMROOT%\System32\netmon\*.* 
898         to %SYSTEMROOT%\System32\netmon\*.* on the Workstation and set 
899         permissions as  you deem appropriate for your site. You will need 
900         administrative rights on the NT box to run netmon.
901         </para>
902
903         <para>
904         To install Netmon on a Windows 9x box install the network monitor agent 
905         from the Windows 9x CD (\admin\nettools\netmon).  There is a readme 
906         file located with the netmon driver files on the CD if you need 
907         information on how to do this.  Copy the files from a working 
908         Netmon installation.
909         </para> 
910 </listitem>
911
912
913
914
915 <listitem>
916         <para>
917         The following is a list if helpful URLs and other links:
918         </para>
919
920         <itemizedlist>
921
922         <listitem><para>Home of Samba site <ulink url="http://samba.org">
923         http://samba.org</ulink>. We have a mirror near you !</para></listitem>
924
925         <listitem><para> The <emphasis>Development</emphasis> document 
926         on the Samba mirrors might mention your problem. If so,
927         it might mean that the developers are working on it.</para></listitem>
928  
929         <listitem><para>See how Scott Merrill simulates a BDC behavior at 
930         <ulink url="http://www.skippy.net/linux/smb-howto.html">
931         http://www.skippy.net/linux/smb-howto.html</ulink>. </para></listitem>
932
933         <listitem><para>Although 2.0.7 has almost had its day as a PDC, David Bannon will
934         keep the 2.0.7 PDC pages at <ulink url="http://bioserve.latrobe.edu.au/samba">
935         http://bioserve.latrobe.edu.au/samba</ulink> going for a while yet.</para></listitem>
936
937         <listitem><para>Misc links to CIFS information 
938         <ulink url="http://samba.org/cifs/">http://samba.org/cifs/</ulink></para></listitem>
939
940         <listitem><para>NT Domains for Unix <ulink url="http://mailhost.cb1.com/~lkcl/ntdom/">
941         http://mailhost.cb1.com/~lkcl/ntdom/</ulink></para></listitem>
942
943         <listitem><para>FTP site for older SMB specs: 
944         <ulink url="ftp://ftp.microsoft.com/developr/drg/CIFS/">
945         ftp://ftp.microsoft.com/developr/drg/CIFS/</ulink></para></listitem>
946
947         </itemizedlist>
948 </listitem>
949 </itemizedlist>
950
951
952 <itemizedlist>
953 <listitem>
954         <para>
955         <emphasis>How do I get help from the mailing lists?</emphasis>
956         </para>
957
958         <para>
959         There are a number of Samba related mailing lists. Go to <ulink 
960         url="http://samba.org">http://samba.org</ulink>, click on your nearest mirror
961         and then click on <command>Support</command> and then click on <command>
962         Samba related mailing lists</command>.
963         </para>
964
965         <para>
966         For questions relating to Samba TNG go to
967         <ulink url="http://www.samba-tng.org/">http://www.samba-tng.org/</ulink> 
968         It has been requested that you don't post questions about Samba-TNG to the
969         main stream Samba lists.</para>
970          
971         <para>
972         If you post a message to one of the lists please observe the following guide lines :
973         </para>
974
975         <itemizedlist>
976
977         <listitem><para> Always remember that the developers are volunteers, they are 
978                 not paid and they never guarantee to produce a particular feature at 
979                 a particular time. Any time lines are 'best guess' and nothing more.
980                 </para></listitem>
981
982         <listitem><para> Always mention what version of samba you are using and what 
983                 operating system its running under. You should probably list the
984         relevant sections of your smb.conf file, at least the options 
985         in [global] that affect PDC support.</para></listitem>
986
987     <listitem><para>In addition to the version, if you obtained Samba via
988         CVS mention the date when you last checked it out.</para></listitem>
989
990         <listitem><para> Try and make your question clear and brief, lots of long, 
991                 convoluted questions get deleted before they are completely read ! 
992                 Don't post html encoded messages (if you can select colour or font 
993                 size its html).</para></listitem>
994
995         <listitem><para> If you run one of those nifty 'I'm on holidays' things when 
996                 you are away, make sure its configured  to not answer mailing lists.
997                 </para></listitem> 
998
999         <listitem><para> Don't cross post. Work out which is the best list to post to 
1000                 and see what happens, i.e. don't post to both samba-ntdom and samba-technical.
1001         Many people active on the lists subscribe to more 
1002                 than one list and get annoyed to see the same message two or more times. 
1003                 Often someone will see a message and thinking it would be better dealt 
1004                 with on another, will forward it on for you.</para></listitem>
1005
1006     <listitem><para>You might include <emphasis>partial</emphasis>
1007         log files written at a debug level set to as much as 20.  
1008         Please don't send the entire log but enough to give the context of the 
1009         error messages.</para></listitem>
1010
1011     <listitem><para>(Possibly) If you have a complete netmon trace ( from the opening of 
1012         the pipe to the error ) you can send the *.CAP file as well.</para></listitem> 
1013
1014     <listitem><para>Please think carefully before attaching a document to an email.
1015         Consider pasting the relevant parts into the body of the message. The samba
1016         mailing lists go to a huge number of people, do they all need a copy of your 
1017         smb.conf in their attach directory?</para></listitem>
1018
1019         </itemizedlist>
1020 </listitem>
1021
1022
1023 <listitem>
1024         <para>
1025         <emphasis>How do I get off the mailing lists?</emphasis>
1026         </para>
1027
1028         <para>To have your name removed from a samba mailing list, go to the
1029         same place you went to to get on it. Go to <ulink 
1030         url="http://lists.samba.org/">http://lists.samba.org</ulink>, 
1031         click on your nearest mirror and then click on <command>Support</command> and 
1032         then click on <command> Samba related mailing lists</command>. Or perhaps see 
1033         <ulink url="http://lists.samba.org/mailman/roster/samba-ntdom">here</ulink>
1034         </para>
1035
1036         <para>
1037         Please don't post messages to the list asking to be removed, you will just
1038         be referred to the above address (unless that process failed in some way...)
1039         </para>
1040 </listitem>
1041 </itemizedlist>
1042
1043 </sect1>
1044
1045
1046 <!-- **********************************************************
1047
1048      Windows 9x domain control
1049
1050 *************************************************************** -->
1051 <sect1>
1052 <title>Domain Control for Windows 9x/ME</title>
1053
1054 <note>
1055 <para>
1056 The following section contains much of the original 
1057 DOMAIN.txt file previously included with Samba.  Much of 
1058 the material is based on what went into the book <emphasis>Special 
1059 Edition, Using Samba</emphasis>, by Richard Sharpe.
1060 </para>
1061 </note>
1062
1063 <para>
1064 A domain and a workgroup are exactly the same thing in terms of network
1065 browsing.  The difference is that a distributable authentication
1066 database is associated with a domain, for secure login access to a
1067 network.  Also, different access rights can be granted to users if they
1068 successfully authenticate against a domain logon server (NT server and 
1069 other systems based on NT server support this, as does at least Samba TNG now).
1070 </para>
1071
1072 <para>
1073 The SMB client logging on to a domain has an expectation that every other
1074 server in the domain should accept the same authentication information.
1075 Network browsing functionality of domains and workgroups is
1076 identical and is explained in BROWSING.txt. It should be noted, that browsing
1077 is totally orthogonal to logon support.
1078 </para>
1079
1080 <para>
1081 Issues related to the single-logon network model are discussed in this
1082 section.  Samba supports domain logons, network logon scripts, and user
1083 profiles for MS Windows for workgroups and MS Windows 9X/ME clients
1084 which will be the focus of this section.
1085 </para>
1086
1087
1088 <para>
1089 When an SMB client in a domain wishes to logon it broadcast requests for a
1090 logon server.  The first one to reply gets the job, and validates its
1091 password using whatever mechanism the Samba administrator has installed.
1092 It is possible (but very stupid) to create a domain where the user
1093 database is not shared between servers, i.e. they are effectively workgroup
1094 servers advertising themselves as participating in a domain.  This
1095 demonstrates how authentication is quite different from but closely
1096 involved with domains.
1097 </para>
1098
1099
1100 <para>
1101 Using these features you can make your clients verify their logon via
1102 the Samba server; make clients run a batch file when they logon to
1103 the network and download their preferences, desktop and start menu.
1104 </para>
1105
1106 <para>
1107 Before launching into the configuration instructions, it is 
1108 worthwhile lookingat how a Windows 9x/ME client performs a logon:
1109 </para>
1110
1111 <orderedlist>
1112 <listitem>
1113         <para>
1114         The client broadcasts (to the IP broadcast address of the subnet it is in)
1115         a NetLogon request. This is sent to the NetBIOS name DOMAIN&lt;1c&gt; at the
1116         NetBIOS layer.  The client chooses the first response it receives, which
1117         contains the NetBIOS name of the logon server to use in the format of 
1118         \\SERVER.
1119         </para>
1120 </listitem>
1121
1122 <listitem>
1123         <para>
1124         The client then connects to that server, logs on (does an SMBsessetupX) and
1125         then connects to the IPC$ share (using an SMBtconX).
1126         </para>
1127 </listitem>
1128
1129 <listitem>
1130         <para>
1131         The client then does a NetWkstaUserLogon request, which retrieves the name
1132         of the user's logon script. 
1133         </para>
1134 </listitem>
1135
1136 <listitem>
1137         <para>
1138         The client then connects to the NetLogon share and searches for this    
1139         and if it is found and can be read, is retrieved and executed by the client.
1140         After this, the client disconnects from the NetLogon share.
1141         </para>
1142 </listitem>
1143
1144 <listitem>
1145         <para>
1146         The client then sends a NetUserGetInfo request to the server, to retrieve
1147         the user's home share, which is used to search for profiles. Since the
1148         response to the NetUserGetInfo request does not contain much more       
1149         the user's home share, profiles for Win9X clients MUST reside in the user
1150         home directory.
1151         </para>
1152 </listitem>
1153
1154 <listitem>
1155         <para>
1156         The client then connects to the user's home share and searches for the 
1157         user's profile. As it turns out, you can specify the user's home share as
1158         a sharename and path. For example, \\server\fred\.profile.
1159         If the profiles are found, they are implemented.
1160         </para>
1161 </listitem>
1162
1163 <listitem>
1164         <para>
1165         The client then disconnects from the user's home share, and reconnects to
1166         the NetLogon share and looks for CONFIG.POL, the policies file. If this is
1167         found, it is read and implemented.
1168         </para>
1169 </listitem>
1170 </orderedlist>
1171
1172
1173 <sect2>
1174 <title>Configuration Instructions:      Network Logons</title>
1175
1176 <para>
1177 The main difference between a PDC and a Windows 9x logon 
1178 server configuration is that
1179 </para>
1180
1181 <itemizedlist>
1182
1183 <listitem><para>
1184 Password encryption is not required for a Windows 9x logon server.
1185 </para></listitem>
1186
1187 <listitem><para>
1188 Windows 9x/ME clients do not possess machine trust accounts.
1189 </para></listitem>
1190
1191 </itemizedlist>
1192
1193 <para>
1194 Therefore, a Samba PDC will also act as a Windows 9x logon 
1195 server.
1196 </para>
1197
1198
1199 <warning>
1200 <title>security mode and master browsers</title>
1201
1202 <para>
1203 There are a few comments to make in order to tie up some 
1204 loose ends.  There has been much debate over the issue of whether
1205 or not it is ok to configure Samba as a Domain Controller in security
1206 modes other than <constant>USER</constant>.  The only security mode 
1207 which  will not work due to technical reasons is <constant>SHARE</constant>
1208 mode security.  <constant>DOMAIN</constant> and <constant>SERVER</constant>
1209 mode security is really just a variation on SMB user level security.
1210 </para>
1211
1212 <para>
1213 Actually, this issue is also closely tied to the debate on whether 
1214 or not Samba must be the domain master browser for its workgroup
1215 when operating as a DC.  While it may technically be possible
1216 to configure a server as such (after all, browsing and domain logons
1217 are two distinctly different functions), it is not a good idea to
1218 so.  You should remember that the DC must register the DOMAIN#1b NetBIOS 
1219 name.  This is the name used by Windows clients to locate the DC.
1220 Windows clients do not distinguish between the DC and the DMB.
1221 For this reason, it is very wise to configure the Samba DC as the DMB.
1222 </para>
1223
1224 <para>
1225 Now back to the issue of configuring a Samba DC to use a mode other
1226 than "security = user".  If a Samba host is configured to use 
1227 another SMB server or DC in order to validate user connection 
1228 requests, then it is a fact that some other machine on the network 
1229 (the "password server") knows more about user than the Samba host.
1230 99% of the time, this other host is a domain controller.  Now 
1231 in order to operate in domain mode security, the "workgroup" parameter
1232 must be set to the name of the Windows NT domain (which already 
1233 has a domain controller, right?)
1234 </para>
1235
1236 <para>
1237 Therefore configuring a Samba box as a DC for a domain that 
1238 already by definition has a PDC is asking for trouble.
1239 Therefore, you should always configure the Samba DC to be the DMB
1240 for its domain.
1241 </para>
1242 </warning>
1243
1244 </sect2>
1245
1246
1247 <sect2>
1248 <title>Configuration Instructions:      Setting up Roaming User Profiles</title>
1249
1250 <warning>
1251 <para>
1252 <emphasis>NOTE!</emphasis> Roaming profiles support is different 
1253 for Win9X and WinNT.
1254 </para>
1255 </warning>
1256
1257 <para>
1258 Before discussing how to configure roaming profiles, it is useful to see how
1259 Win9X and WinNT clients implement these features.
1260 </para>
1261
1262 <para>
1263 Win9X clients send a NetUserGetInfo request to the server to get the user's
1264 profiles location. However, the response does not have room for a separate 
1265 profiles location field, only the user's home share. This means that Win9X 
1266 profiles are restricted to being in the user's home directory.
1267 </para>
1268
1269
1270 <para>
1271 WinNT clients send a NetSAMLogon RPC request, which contains many fields, 
1272 including a separate field for the location of the user's profiles. 
1273 This means that support for profiles is different for Win9X and WinNT.
1274 </para>
1275
1276
1277
1278 <sect3>
1279 <title>Windows NT Configuration</title>
1280
1281 <para>
1282 To support WinNT clients, in the [global] section of smb.conf set the
1283 following (for example):
1284 </para>
1285
1286 <para><programlisting>
1287 logon path = \\profileserver\profileshare\profilepath\%U\moreprofilepath
1288 </programlisting></para>
1289
1290 <para>
1291 The default for this option is \\%N\%U\profile, namely
1292 \\sambaserver\username\profile.  The \\N%\%U service is created
1293 automatically by the [homes] service.
1294 If you are using a samba server for the profiles, you _must_ make the
1295 share specified in the logon path browseable. 
1296 </para>
1297
1298 <note>
1299 <para>
1300 [lkcl 26aug96 - we have discovered a problem where Windows clients can
1301 maintain a connection to the [homes] share in between logins.  The
1302 [homes] share must NOT therefore be used in a profile path.]
1303 </para>
1304 </note>
1305
1306 </sect3>
1307
1308
1309 <sect3>
1310 <title>Windows 9X Configuration</title>
1311
1312 <para>
1313 To support Win9X clients, you must use the "logon home" parameter. Samba has
1314 now been fixed so that "net use/home" now works as well, and it, too, relies
1315 on the "logon home" parameter.
1316 </para>
1317
1318 <para>
1319 By using the logon home parameter, you are restricted to putting Win9X 
1320 profiles in the user's home directory.   But wait! There is a trick you 
1321 can use. If you set the following in the [global] section of your 
1322 smb.conf file:
1323 </para>
1324
1325 <para><programlisting>
1326 logon home = \\%L\%U\.profiles
1327 </programlisting></para>
1328
1329 <para>
1330 then your Win9X clients will dutifully put their clients in a subdirectory
1331 of your home directory called .profiles (thus making them hidden).
1332 </para>
1333
1334 <para>
1335 Not only that, but 'net use/home' will also work, because of a feature in 
1336 Win9X. It removes any directory stuff off the end of the home directory area
1337 and only uses the server and share portion. That is, it looks like you
1338 specified \\%L\%U for "logon home".
1339 </para>
1340
1341
1342 </sect3>
1343
1344
1345 <sect3>
1346 <title>Win9X and WinNT Configuration</title>
1347
1348 <para>
1349 You can support profiles for both Win9X and WinNT clients by setting both the
1350 "logon home" and "logon path" parameters. For example:
1351 </para>
1352
1353 <para><programlisting>
1354 logon home = \\%L\%U\.profiles
1355 logon path = \\%L\profiles\%U
1356 </programlisting></para>
1357
1358 <note>
1359 <para>
1360 I have not checked what 'net use /home' does on NT when "logon home" is
1361 set as above.
1362 </para>
1363 </note>
1364 </sect3>
1365
1366
1367
1368 <sect3>
1369 <title>Windows 9X Profile Setup</title>
1370
1371 <para>
1372 When a user first logs in on Windows 9X, the file user.DAT is created,
1373 as are folders "Start Menu", "Desktop", "Programs" and "Nethood".  
1374 These directories and their contents will be merged with the local
1375 versions stored in c:\windows\profiles\username on subsequent logins,
1376 taking the most recent from each.  You will need to use the [global]
1377 options "preserve case = yes", "short preserve case = yes" and
1378 "case sensitive = no" in order to maintain capital letters in shortcuts
1379 in any of the profile folders.
1380 </para>
1381
1382
1383 <para>
1384 The user.DAT file contains all the user's preferences.  If you wish to
1385 enforce a set of preferences, rename their user.DAT file to user.MAN,
1386 and deny them write access to this file.
1387 </para>
1388
1389 <orderedlist>
1390 <listitem>
1391         <para>
1392         On the Windows 95 machine, go to Control Panel | Passwords and
1393         select the User Profiles tab.  Select the required level of
1394         roaming preferences.  Press OK, but do _not_ allow the computer
1395         to reboot.
1396         </para>
1397 </listitem>
1398
1399
1400 <listitem>
1401         <para>
1402         On the Windows 95 machine, go to Control Panel | Network |
1403         Client for Microsoft Networks | Preferences.  Select 'Log on to
1404         NT Domain'.  Then, ensure that the Primary Logon is 'Client for
1405         Microsoft Networks'.  Press OK, and this time allow the computer
1406         to reboot.
1407         </para>
1408 </listitem>
1409
1410 </orderedlist>
1411
1412 <para>
1413 Under Windows 95, Profiles are downloaded from the Primary Logon.
1414 If you have the Primary Logon as 'Client for Novell Networks', then
1415 the profiles and logon script will be downloaded from your Novell
1416 Server.  If you have the Primary Logon as 'Windows Logon', then the
1417 profiles will be loaded from the local machine - a bit against the
1418 concept of roaming profiles, if you ask me.
1419 </para>
1420
1421 <para>
1422 You will now find that the Microsoft Networks Login box contains
1423 [user, password, domain] instead of just [user, password].  Type in
1424 the samba server's domain name (or any other domain known to exist,
1425 but bear in mind that the user will be authenticated against this
1426 domain and profiles downloaded from it, if that domain logon server
1427 supports it), user name and user's password.
1428 </para>
1429
1430 <para>
1431 Once the user has been successfully validated, the Windows 95 machine
1432 will inform you that 'The user has not logged on before' and asks you
1433 if you wish to save the user's preferences?  Select 'yes'.
1434 </para>
1435
1436 <para>
1437 Once the Windows 95 client comes up with the desktop, you should be able
1438 to examine the contents of the directory specified in the "logon path"
1439 on the samba server and verify that the "Desktop", "Start Menu",
1440 "Programs" and "Nethood" folders have been created.
1441 </para>
1442
1443 <para>
1444 These folders will be cached locally on the client, and updated when
1445 the user logs off (if you haven't made them read-only by then :-).
1446 You will find that if the user creates further folders or short-cuts,
1447 that the client will merge the profile contents downloaded with the
1448 contents of the profile directory already on the local client, taking
1449 the newest folders and short-cuts from each set.
1450 </para>
1451
1452 <para>
1453 If you have made the folders / files read-only on the samba server,
1454 then you will get errors from the w95 machine on logon and logout, as
1455 it attempts to merge the local and the remote profile.  Basically, if
1456 you have any errors reported by the w95 machine, check the Unix file
1457 permissions and ownership rights on the profile directory contents,
1458 on the samba server.
1459 </para>
1460
1461 <para>
1462 If you have problems creating user profiles, you can reset the user's
1463 local desktop cache, as shown below.  When this user then next logs in,
1464 they will be told that they are logging in "for the first time".
1465 </para>
1466
1467 <orderedlist>
1468 <listitem>
1469         <para>
1470         instead of logging in under the [user, password, domain] dialog,
1471         press escape.
1472         </para>
1473 </listitem>
1474
1475 <listitem>
1476         <para>
1477         run the regedit.exe program, and look in:
1478         </para>
1479         
1480         <para>
1481         HKEY_LOCAL_MACHINE\Windows\CurrentVersion\ProfileList
1482         </para>
1483
1484         <para>
1485         you will find an entry, for each user, of ProfilePath.  Note the
1486         contents of this key (likely to be c:\windows\profiles\username),
1487         then delete the key ProfilePath for the required user.
1488         </para>
1489
1490         <para>
1491         [Exit the registry editor].
1492         </para>
1493 </listitem>
1494
1495 <listitem>
1496         <para>
1497         <emphasis>WARNING</emphasis> - before deleting the contents of the 
1498         directory listed in
1499    the ProfilePath (this is likely to be c:\windows\profiles\username),
1500    ask them if they have any important files stored on their desktop
1501    or in their start menu.  delete the contents of the directory
1502    ProfilePath (making a backup if any of the files are needed).
1503         </para>
1504
1505         <para>
1506    This will have the effect of removing the local (read-only hidden
1507    system file) user.DAT in their profile directory, as well as the
1508    local "desktop", "nethood", "start menu" and "programs" folders.
1509         </para>
1510 </listitem>
1511
1512 <listitem>
1513         <para>
1514         search for the user's .PWL password-caching file in the c:\windows
1515         directory, and delete it.
1516         </para>
1517 </listitem>
1518
1519
1520 <listitem>
1521         <para>
1522         log off the windows 95 client.
1523         </para>
1524 </listitem>
1525
1526 <listitem>
1527         <para>
1528         check the contents of the profile path (see "logon path" described
1529         above), and delete the user.DAT or user.MAN file for the user,
1530         making a backup if required.  
1531         </para>
1532 </listitem>
1533
1534 </orderedlist>
1535
1536 <para>
1537 If all else fails, increase samba's debug log levels to between 3 and 10,
1538 and / or run a packet trace program such as tcpdump or netmon.exe, and
1539 look for any error reports.
1540 </para>
1541
1542 <para>
1543 If you have access to an NT server, then first set up roaming profiles
1544 and / or netlogons on the NT server.  Make a packet trace, or examine
1545 the example packet traces provided with NT server, and see what the
1546 differences are with the equivalent samba trace.
1547 </para>
1548
1549 </sect3>
1550
1551
1552 <sect3>
1553 <title>Windows NT Workstation 4.0</title>
1554
1555 <para>
1556 When a user first logs in to a Windows NT Workstation, the profile
1557 NTuser.DAT is created.  The profile location can be now specified
1558 through the "logon path" parameter.  
1559 </para>
1560
1561 <note>
1562 <para>
1563 [lkcl 10aug97 - i tried setting the path to
1564 \\samba-server\homes\profile, and discovered that this fails because
1565 a background process maintains the connection to the [homes] share
1566 which does _not_ close down in between user logins.  you have to
1567 have \\samba-server\%L\profile, where user is the username created
1568 from the [homes] share].
1569 </para>
1570 </note>
1571
1572 <para>
1573 There is a parameter that is now available for use with NT Profiles:
1574 "logon drive".  This should be set to "h:" or any other drive, and
1575 should be used in conjunction with the new "logon home" parameter.
1576 </para>
1577
1578 <para>
1579 The entry for the NT 4.0 profile is a _directory_ not a file.  The NT
1580 help on profiles mentions that a directory is also created with a .PDS
1581 extension.  The user, while logging in, must have write permission to
1582 create the full profile path (and the folder with the .PDS extension)
1583 [lkcl 10aug97 - i found that the creation of the .PDS directory failed,
1584 and had to create these manually for each user, with a shell script.
1585 also, i presume, but have not tested, that the full profile path must
1586 be browseable just as it is for w95, due to the manner in which they
1587 attempt to create the full profile path: test existence of each path
1588 component; create path component].
1589 </para>
1590
1591 <para>
1592 In the profile directory, NT creates more folders than 95.  It creates
1593 "Application Data" and others, as well as "Desktop", "Nethood",
1594 "Start Menu" and "Programs".  The profile itself is stored in a file
1595 NTuser.DAT.  Nothing appears to be stored in the .PDS directory, and
1596 its purpose is currently unknown.
1597 </para>
1598
1599 <para>
1600 You can use the System Control Panel to copy a local profile onto
1601 a samba server (see NT Help on profiles: it is also capable of firing
1602 up the correct location in the System Control Panel for you).  The
1603 NT Help file also mentions that renaming NTuser.DAT to NTuser.MAN
1604 turns a profile into a mandatory one.
1605 </para>
1606
1607 <note>
1608 <para>
1609 [lkcl 10aug97 - i notice that NT Workstation tells me that it is
1610 downloading a profile from a slow link.  whether this is actually the
1611 case, or whether there is some configuration issue, as yet unknown,
1612 that makes NT Workstation _think_ that the link is a slow one is a
1613 matter to be resolved].
1614 </para>
1615
1616 <para>
1617 [lkcl 20aug97 - after samba digest correspondence, one user found, and
1618 another confirmed, that profiles cannot be loaded from a samba server
1619 unless "security = user" and "encrypt passwords = yes" (see the file
1620 ENCRYPTION.txt) or "security = server" and "password server = ip.address.
1621 of.yourNTserver" are used.  Either of these options will allow the NT
1622 workstation to access the samba server using LAN manager encrypted
1623 passwords, without the user intervention normally required by NT
1624 workstation for clear-text passwords].
1625 </para>
1626
1627 <para>
1628 [lkcl 25aug97 - more comments received about NT profiles: the case of
1629 the profile _matters_.  the file _must_ be called NTuser.DAT or, for
1630 a mandatory profile, NTuser.MAN].
1631 </para>
1632 </note>
1633
1634 </sect3>
1635
1636
1637 <sect3>
1638 <title>Windows NT Server</title>
1639
1640 <para>
1641 There is nothing to stop you specifying any path that you like for the
1642 location of users' profiles.  Therefore, you could specify that the
1643 profile be stored on a samba server, or any other SMB server, as long as
1644 that SMB server supports encrypted passwords.
1645 </para>
1646
1647 </sect3>
1648
1649
1650 <sect3>
1651 <title>Sharing Profiles between W95 and NT Workstation 4.0</title>
1652
1653 <warning>
1654 <title>Potentially outdated or incorrect material follows</title>
1655 <para>
1656 I think this is all bogus, but have not deleted it. (Richard Sharpe)
1657 </para>
1658 </warning>
1659
1660 <para>
1661 The default logon path is \\%N\%U.  NT Workstation will attempt to create
1662 a directory "\\samba-server\username.PDS" if you specify the logon path
1663 as "\\samba-server\username" with the NT User Manager.  Therefore, you
1664 will need to specify (for example) "\\samba-server\username\profile".
1665 NT 4.0 will attempt to create "\\samba-server\username\profile.PDS", which
1666 is more likely to succeed.
1667 </para>
1668
1669 <para>
1670 If you then want to share the same Start Menu / Desktop with W95, you will
1671 need to specify "logon path = \\samba-server\username\profile" [lkcl 10aug97
1672 this has its drawbacks: i created a shortcut to telnet.exe, which attempts
1673 to run from the c:\winnt\system32 directory.  this directory is obviously
1674 unlikely to exist on a Win95-only host].
1675 </para>
1676
1677 <para>
1678
1679 If you have this set up correctly, you will find separate user.DAT and
1680 NTuser.DAT files in the same profile directory.
1681 </para>
1682
1683 <note>
1684 <para>
1685 [lkcl 25aug97 - there are some issues to resolve with downloading of
1686 NT profiles, probably to do with time/date stamps.  i have found that
1687 NTuser.DAT is never updated on the workstation after the first time that
1688 it is copied to the local workstation profile directory.  this is in
1689 contrast to w95, where it _does_ transfer / update profiles correctly].
1690 </para>
1691 </note>
1692
1693 </sect3>
1694
1695 </sect2>
1696 </sect1>
1697
1698
1699 <!-- **********************************************************
1700
1701      Appendix - DOMAIN_CONTROL.txt
1702
1703 *************************************************************** -->
1704
1705 <sect1>
1706 <title>
1707 DOMAIN_CONTROL.txt : Windows NT Domain Control &amp; Samba
1708 </title>
1709
1710 <warning>
1711         <title>Possibly Outdated Material</title>
1712
1713         <para>
1714         This appendix was originally authored by John H Terpstra of 
1715         the Samba Team and is included here for posterity.
1716         </para>
1717 </warning>
1718
1719
1720 <para>
1721 <emphasis>NOTE :</emphasis> 
1722 The term "Domain Controller" and those related to it refer to one specific
1723 method of authentication that can underly an SMB domain. Domain Controllers
1724 prior to Windows NT Server 3.1 were sold by various companies and based on 
1725 private extensions to the LAN Manager 2.1 protocol. Windows NT introduced
1726 Microsoft-specific ways of distributing the user authentication database.
1727 See DOMAIN.txt for examples of how Samba can participate in or create
1728 SMB domains based on shared authentication database schemes other than the 
1729 Windows NT SAM.
1730 </para>
1731
1732 <para>
1733 Windows NT Server can be installed as either a plain file and print server
1734 (WORKGROUP workstation or server) or as a server that participates in Domain
1735 Control (DOMAIN member, Primary Domain controller or Backup Domain controller).
1736 The same is true for OS/2 Warp Server, Digital Pathworks and other similar
1737 products, all of which can participate in Domain Control along with Windows NT.
1738 </para>
1739
1740 <para>
1741 To many people these terms can be confusing, so let's try to clear the air.
1742 </para>
1743
1744 <para>
1745 Every Windows NT system (workstation or server) has a registry database.
1746 The registry contains entries that describe the initialization information
1747 for all services (the equivalent of Unix Daemons) that run within the Windows
1748 NT environment. The registry also contains entries that tell application
1749 software where to find dynamically loadable libraries that they depend upon.
1750 In fact, the registry contains entries that describes everything that anything
1751 may need to know to interact with the rest of the system.
1752 </para>
1753
1754 <para>
1755 The registry files can be located on any Windows NT machine by opening a
1756 command prompt and typing:
1757 </para>
1758
1759 <para>
1760 <prompt>C:\WINNT\></prompt> dir %SystemRoot%\System32\config
1761 </para>
1762
1763 <para>
1764 The environment variable %SystemRoot% value can be obtained by typing:
1765 </para>
1766
1767 <para>
1768 <prompt>C:\WINNT></prompt>echo %SystemRoot%
1769 </para>
1770
1771 <para>
1772 The active parts of the registry that you may want to be familiar with are
1773 the files called: default, system, software, sam and security.
1774 </para>
1775
1776 <para>
1777 In a domain environment, Microsoft Windows NT domain controllers participate
1778 in replication of the SAM and SECURITY files so that all controllers within
1779 the domain have an exactly identical copy of each.
1780 </para>
1781
1782 <para>
1783 The Microsoft Windows NT system is structured within a security model that
1784 says that all applications and services must authenticate themselves before
1785 they can obtain permission from the security manager to do what they set out
1786 to do.
1787 </para>
1788
1789 <para>
1790 The Windows NT User database also resides within the registry. This part of
1791 the registry contains the user's security identifier, home directory, group
1792 memberships, desktop profile, and so on.
1793 </para>
1794
1795 <para>
1796 Every Windows NT system (workstation as well as server) will have its own
1797 registry. Windows NT Servers that participate in Domain Security control
1798 have a database that they share in common - thus they do NOT own an
1799 independent full registry database of their own, as do Workstations and
1800 plain Servers.
1801 </para>
1802
1803 <para>
1804 The User database is called the SAM (Security Access Manager) database and
1805 is used for all user authentication as well as for authentication of inter-
1806 process authentication (i.e. to ensure that the service action a user has
1807 requested is permitted within the limits of that user's privileges).
1808 </para>
1809
1810 <para>
1811 The Samba team have produced a utility that can dump the Windows NT SAM into 
1812 smbpasswd format: see ENCRYPTION.txt for information on smbpasswd and
1813 /pub/samba/pwdump on your nearest Samba mirror for the utility. This 
1814 facility is useful but cannot be easily used to implement SAM replication
1815 to Samba systems.
1816 </para>
1817
1818 <para>
1819 Windows for Workgroups, Windows 95, and Windows NT Workstations and Servers
1820 can participate in a Domain security system that is controlled by Windows NT
1821 servers that have been correctly configured. Almost every domain will have
1822 ONE Primary Domain Controller (PDC). It is desirable that each domain will
1823 have at least one Backup Domain Controller (BDC).
1824 </para>
1825
1826 <para>
1827 The PDC and BDCs then participate in replication of the SAM database so that
1828 each Domain Controlling participant will have an up to date SAM component
1829 within its registry.
1830 </para>
1831
1832 </sect1>
1833
1834 </chapter>