trying to get HEAD building again. If you want the code
[gd/samba-autobuild/.git] / docs / docbook / projdoc / Samba-PDC-HOWTO.xml
1 <chapter id="samba-pdc">
2
3 <chapterinfo>
4         &author.jht;
5         &author.jerry;
6         <author>
7                 <firstname>David</firstname><surname>Bannon</surname>
8                 <affiliation>
9                         <orgname>Samba Team</orgname>
10                         <address><email>dbannon@samba.org</email></address>
11                 </affiliation>
12         </author>
13 </chapterinfo>
14
15 <title>Domain Control</title>
16
17 <formalpara><title><emphasis>The Essence of Learning:</emphasis></title>
18 <para>
19 There are many who approach MS Windows networking with incredible misconceptions.
20 That's OK, because it gives the rest of us plenty of opportunity to be of assistance.
21 Those who really want help would be well advised to become familiar with information
22 that is already available.
23 </para>
24 </formalpara>
25
26 <para>
27 The reader is advised NOT to tackle this section without having first understood
28 and mastered some basics. MS Windows networking is not particularly forgiving of
29 misconfiguration. Users of MS Windows networking are likely to complain bitterly
30 of persistent niggles that may be caused by broken network or system configuration.
31 To a great many people however, MS Windows networking starts with a domain controller
32 that in some magical way is expected to solve all ills.
33 </para>
34
35 <para>
36 From the Samba mailing list one can readily identify many common networking issues.
37 If you are not clear on the following subjects, then it will do much good to read the 
38 sections of this HOWTO that deal with it. These are the most common causes of MS Windows
39 networking problems:
40 </para>
41
42 <simplelist>
43         <member>Basic TCP/IP configuration</member>
44         <member>NetBIOS name resolution</member>
45         <member>Authentication configuration</member>
46         <member>User and Group configuration</member>
47         <member>Basic File and Directory Permission Control in Unix/Linux</member>
48         <member>Understanding of how MS Windows clients interoperate in a network
49                 environment</member>
50 </simplelist>
51
52 <para>
53 Do not be put off; on the surface of it MS Windows networking seems so simple that any fool
54 can do it. In fact, it is not a good idea to set up an MS Windows network with
55 inadequate training and preparation. But let's get our first indelible principle out of the
56 way: <emphasis>It is perfectly OK to make mistakes!</emphasis> In the right place and at
57 the right time, mistakes are the essence of learning. It is <emphasis>very much</emphasis>
58 not ok to make mistakes that cause loss of productivity and impose an avoidable financial
59 burden on an organisation.
60 </para>
61
62 <para>
63 Where is the right place to make mistakes? Only out of harm's way! If you are going to
64 make mistakes, then please do this on a test network, away from users and in such a way as
65 to not inflict pain on others. Do your learning on a test network.
66 </para>
67
68 <sect1>
69 <title>Features and Benefits</title>
70
71 <para>
72 <emphasis>What is the key benefit of Microsoft Domain security?</emphasis>
73 </para>
74
75 <para>
76 In a word, <emphasis>Single Sign On</emphasis>, or SSO for short. To many, this is the holy
77 grail of MS Windows NT and beyond networking. SSO allows users in a well designed network
78 to log onto any workstation that is a member of the domain that their user account is in
79 (or in a domain that has an appropriate trust relationship with the domain they are visiting)
80 and they will be able to log onto the network and access resources (shares, files, and printers)
81 as if they are sitting at their home (personal) workstation. This is a feature of the Domain
82 security protocols.
83 </para>
84
85 <para>
86 The benefits of Domain security are fully available to those sites that deploy a Samba PDC.
87 </para>
88
89 <note><para>
90 Network clients of an MS Windows Domain security environment must be Domain members to be
91 able to gain access to the advanced features provided. Domain membership involves more than just
92 setting the workgroup name to the Domain name. It requires the creation of a Domain trust account
93 for the workstation (called a machine account). Please refer to the chapter on 
94 <link linkend="domain-member">Domain Membership</link> for more information.
95 </para></note>
96
97 <para>
98 The following functionalities are new to the Samba-3 release:
99 </para>
100
101 <itemizedlist>
102         <listitem><para>
103         Windows NT4 domain trusts
104         </para></listitem>
105         
106         <listitem><para>
107         Adding users via the User Manager for Domains. This can be done on any MS Windows
108         client using the Nexus toolkit that is available from Microsoft's web site.
109         At some later date Samba-3 may get support for the use of the Microsoft Management
110         Console for user management.
111         </para></listitem>
112
113         <listitem><para>
114         Introduces replaceable and multiple user account (authentication)
115         back ends. In the case where the back end is placed in an LDAP database,
116         Samba-3 confers the benefits of a back end that can be distributed, replicated,
117         and is highly scalable.
118         </para></listitem>
119
120         <listitem><para>
121         Implements full Unicode support. This simplifies cross locale internationalisation
122         support. It also opens up the use of protocols that Samba-2.2.x had but could not use due
123         to the need to fully support Unicode.
124         </para></listitem>
125 </itemizedlist>
126
127 <para>
128 The following functionalities are NOT provided by Samba-3:
129 </para>
130
131 <itemizedlist>
132         <listitem><para>
133         SAM replication with Windows NT4 Domain Controllers
134         (i.e. a Samba PDC and a Windows NT BDC or vice versa) 
135         </para></listitem>
136         
137         <listitem><para>
138         Acting as a Windows 2000 Domain Controller (i.e. Kerberos and 
139         Active Directory) - In point of fact, Samba-3 DOES have some
140         Active Directory Domain Control ability that is at this time
141         purely experimental <emphasis>AND</emphasis> that is certain
142         to change as it becomes a fully supported feature some time
143         during the Samba-3 (or later) life cycle.
144         </para></listitem>
145 </itemizedlist>
146
147 <para>
148 Windows 9x / Me / XP Home clients are not true members of a domain for reasons outlined
149 in this chapter.  The protocol for support of Windows 9x / Me style network (domain) logons
150 is completely different from NT4 / Win2k type domain logons and has been officially supported
151 for some time. These clients use the old LanMan Network Logon facilities that are supported
152 in Samba since approximately the Samba-1.9.15 series.
153 </para>
154
155 <para>
156 Samba-3 has an implementation of group mapping between Windows NT groups
157 and Unix groups (this is really quite complicated to explain in a short space). This is 
158 discussed more fully in the <link linkend="groupmapping">Group Mapping</link> chapter.
159 </para>
160
161 <para>
162 Samba-3, like an MS Windows NT4 PDC or a Windows 200x Active Directory, needs to store
163 user and machine trust account information in a suitable backend data store. With Samba-3
164 there can be multiple back-ends for this including:
165 </para>
166
167 <!-- FIXME: Doesn't this belong in passdb.xml ? -->
168
169 <itemizedlist>
170         <listitem><para>
171         <emphasis>smbpasswd</emphasis> - the plain ASCII file stored used by
172         earlier versions of Samba. This file configuration option requires
173         a Unix/Linux system account for EVERY entry (ie: both for user and for
174         machine accounts). This file will be located in the <emphasis>private</emphasis>
175         directory (default is /usr/local/samba/lib/private or on linux /etc/samba).
176         </para></listitem>
177
178         <listitem><para>
179         <emphasis>tdbsam</emphasis> - a binary database backend that will be
180         stored in the <emphasis>private</emphasis> directory in a file called
181         <emphasis>passdb.tdb</emphasis>. The key benefit of this binary format
182         file is that it can store binary objects that can not be accommodated
183         in the traditional plain text smbpasswd file. These permit the extended
184         account controls that MS Windows NT4 and later also have.
185         </para></listitem>
186
187         <listitem><para>
188         <emphasis>ldapsam</emphasis> - An LDAP based back-end. Permits the
189         LDAP server to be specified. eg: ldap://localhost or ldap://frodo.murphy.com.
190         Like the tdbsam, ldapsam permits the storing of extended account attributes
191         for control of things like: Permitted access times, password activation and
192         expiry, permitted points of access (workstation names), per user profile
193         location, and much more.
194         </para></listitem>
195
196         <listitem><para>
197         <emphasis>ldapsam_compat</emphasis> - An LDAP back-end that maintains backwards
198         compatibility with the behaviour of samba-2.2.x. You should use this in the process
199         of migrating from samba-2.2.x to samba-3 if you do not want to rebuild your LDAP
200         database.
201         </para></listitem>
202 </itemizedlist>
203
204 <para>
205 Read the chapter about <link linkend="passdb">Account Information Database</link> for details
206 regarding the choices available and how to configure them.
207 </para>
208
209 <note><para>
210 The new tdbsam and ldapsam account backends store substantially more information than
211 smbpasswd is capable of. The new backend database includes capacity to specify
212 per user settings for many parameters, over-riding global settings given in the
213 <filename>smb.conf</filename> file. eg: logon drive, logon home, logon path, etc.
214 Thus, with samba-3 it is possible to have a default system configuration for profiles,
215 and on a per user basis to over-ride this for those users who should not be subject
216 to the default configuration.
217 </para></note>
218
219 </sect1>
220
221 <sect1>
222 <title>Basics of Domain Control</title>
223
224 <para>
225 Over the years, public perceptions of what Domain Control really is has taken on an
226 almost mystical nature. Before we branch into a brief overview of Domain Control,
227 there are three basic types of domain controllers:
228 </para>
229
230 <sect2>
231 <title>Domain Controller Types</title>
232
233 <itemizedlist>
234         <listitem><para>Primary Domain Controller</para></listitem>
235         <listitem><para>Backup Domain Controller</para></listitem>
236         <listitem><para>ADS Domain Controller</para></listitem>
237 </itemizedlist>
238
239 <para>
240 The <emphasis>Primary Domain Controller</emphasis> or PDC plays an important role in the MS 
241 Windows NT4 and Windows 200x Domain Control architecture, but not in the manner that so many
242 expect. There is folk lore that dictates that because of it's role in the MS Windows
243 network, the PDC should be the most powerful and most capable machine in the network.
244 As strange as it may seem to say this here, good over all network performance dictates that
245 the entire infrastructure needs to be balanced. It is advisable to invest more in the Backup
246 Domain Controllers and Stand-Alone (or Domain Member) servers than in the PDC.
247 </para>
248
249 <para>
250 In the case of MS Windows NT4 style domains, it is the PDC seeds the Domain Control database,
251 a part of the Windows registry called the SAM (Security Account Manager). It plays a key
252 part in NT4 type domain user authentication and in synchronisation of the domain authentication
253 database with Backup Domain Controllers. 
254 </para>
255
256 <para>
257 With MS Windows 200x Server based Active Directory domains, one domain controller seeds a potential
258 hierarchy of domain controllers, each with their own area of delegated control. The master domain
259 controller has the ability to override any down-stream controller, but a down-line controller has
260 control only over it's down-line. With Samba-3 this functionality can be implemented using an
261 LDAP based user and machine account back end.
262 </para>
263
264 <para>
265 New to Samba-3 is the ability to use a back-end database that holds the same type of data as
266 the NT4 style SAM (Security Account Manager) database (one of the registry files).
267 The Samba-3 SAM can be specified via the smb.conf file parameter
268 <parameter>passwd backend</parameter> and valid options include
269 <emphasis>smbpasswd, tdbsam, ldapsam, nisplussam, xmlsam, mysqlsam, guest</emphasis>.
270 </para>
271
272 <para>
273 The <emphasis>Backup Domain Controller</emphasis> or BDC plays a key role in servicing network
274 authentication requests. The BDC is biased to answer logon requests in preference to the PDC.
275 On a network segment that has a BDC and a PDC the BDC will be most likely to service network
276 logon requests. The PDC will answer network logon requests when the BDC is too busy (high load).
277 A BDC can be promoted to a PDC. If the PDC is on line at the time that a BDC is promoted to
278 PDC, the previous PDC is automatically demoted to a BDC. With Samba-3 this is NOT an automatic
279 operation; the PDC and BDC must be manually configured and changes need to be made likewise.
280 </para>
281
282 <para>
283 With MS Windows NT4, it is an install time decision what type of machine the server will be.
284 It is possible to change the promote a BDC to a PDC and vice versa only, but the only way
285 to convert a domain controller to a domain member server or a stand-alone server is to
286 reinstall it. The install time choices offered are:
287 </para>
288
289 <itemizedlist>
290         <listitem><para><emphasis>Primary Domain Controller</emphasis> - The one that seeds the domain SAM</para></listitem>
291         <listitem><para><emphasis>Backup Domain Controller</emphasis> - One that obtains a copy of the domain SAM</para></listitem>
292         <listitem><para><emphasis>Domain Member Server</emphasis> - One that has NO copy of the domain SAM, rather it obtains authentication from a Domain Controller for all access controls.</para></listitem>
293         <listitem><para><emphasis>Stand-Alone Server</emphasis> - One that plays NO part is SAM synchronisation, has it's own authentication database and plays no role in Domain security.</para></listitem>
294 </itemizedlist>
295
296 <para>
297 With MS Windows 2000 the configuration of domain control is done after the server has been
298 installed. Samba-3 is capable of acting fully as a native member of a Windows 200x server
299 Active Directory domain.
300 </para>
301
302 <para>
303 New to Samba-3 is the ability to function fully as an MS Windows NT4 style Domain Controller,
304 excluding the SAM replication components. However, please be aware that Samba-3 support the
305 MS Windows 200x domain control protocols also.
306 </para>
307
308 <para>
309 At this time any appearance that Samba-3 is capable of acting as an
310 <emphasis>ADS Domain Controller</emphasis> is limited and experimental in nature.
311 This functionality should not be used until the Samba-Team offers formal support for it.
312 At such a time, the documentation will be revised to duly reflect all configuration and
313 management requirements.
314 </para>
315
316 </sect2>
317
318 <sect2>
319 <title>Preparing for Domain Control</title>
320
321 <para>
322 There are two ways that MS Windows machines may interact with each other, with other servers,
323 and with Domain Controllers: Either as <emphasis>Stand-Alone</emphasis> systems, more commonly
324 called <emphasis>Workgroup</emphasis> members, or as full participants in a security system,
325 more commonly called <emphasis>Domain</emphasis> members.
326 </para>
327
328 <para>
329 It should be noted that <emphasis>Workgroup</emphasis> membership involve no special configuration
330 other than the machine being configured so that the network configuration has a commonly used name
331 for it's workgroup entry. It is not uncommon for the name WORKGROUP to be used for this. With this
332 mode of configuration there are NO machine trust accounts and any concept of membership as such
333 is limited to the fact that all machines appear in the network neighbourhood to be logically
334 grouped together. Again, just to be clear: <emphasis>workgroup mode does not involve any security machine 
335 accounts</emphasis>.
336 </para>
337
338 <para>
339 Domain member machines have a machine account in the Domain accounts database. A special procedure
340 must be followed on each machine to affect Domain membership. This procedure, which can be done
341 only by the local machine Administrator account, will create the Domain machine account (if
342 if does not exist), and then initializes that account. When the client first logs onto the
343 Domain it triggers a machine password change.
344 </para>
345
346 <note><para>
347 When running a Domain all MS Windows NT / 200x / XP Professional clients should be configured
348 as full Domain Members - IF A SECURE NETWORK IS WANTED. If the machine is NOT made a member of the
349 Domain, then it will operate like a workgroup (stand-alone) machine. Please refer the 
350 <link linkend="domain-member">Domain Membership</link> chapter for information regarding
351  HOW to make your MS Windows clients Domain members.
352 </para></note>
353
354 <para>
355 The following are necessary for configuring Samba-3 as an MS Windows NT4 style PDC for MS Windows
356 NT4 / 200x / XP clients.
357 </para>
358
359 <simplelist>
360         <member>Configuration of basic TCP/IP and MS Windows Networking</member>
361         <member>Correct designation of the Server Role (<parameter>security = user</parameter>)</member>
362         <member>Consistent configuration of Name Resolution (See chapter on <link linkend="NetworkBrowsing">Browsing</link> and on
363         <link linkend="integrate-ms-networks">MS Windows network Integration</link>)</member>
364         <member>Domain logons for Windows NT4 / 200x / XP Professional clients</member>
365         <member>Configuration of Roaming Profiles or explicit configuration to force local profile usage</member>
366         <member>Configuration of Network/System Policies</member>
367         <member>Adding and managing domain user accounts</member>
368         <member>Configuring MS Windows client machines to become domain members</member>
369 </simplelist>
370
371 <para>
372 The following provisions are required to serve MS Windows 9x / Me Clients:
373 </para>
374
375 <simplelist>
376         <member>Configuration of basic TCP/IP and MS Windows Networking</member>
377         <member>Correct designation of the Server Role (<parameter>security = user</parameter>)</member>
378         <member>Network Logon Configuration (Since Windows 9x / XP Home are not technically domain
379         members, they do not really participate in  the security aspects of Domain logons as such)</member>
380         <member>Roaming Profile Configuration</member>
381         <member>Configuration of System Policy handling</member>
382         <member>Installation of the Network driver "Client for MS Windows Networks" and configuration
383         to log onto the domain</member>
384         <member>Placing Windows 9x / Me clients in user level security - if it is desired to allow
385         all client share access to be controlled according to domain user / group identities.</member>
386         <member>Adding and managing domain user accounts</member>
387 </simplelist>
388
389 <note><para>
390 Roaming Profiles and System/Network policies are advanced network administration topics
391 that are covered in the <link linkend="ProfileMgmt">Profile Management</link> and 
392 <link linkend="PolicyMgmt">Policy Management</link> chapters of this document.  However, these are not necessarily specific
393 to a Samba PDC as much as they are related to Windows NT networking concepts.
394 </para></note>
395
396 <para>
397 A Domain Controller is an SMB/CIFS server that:
398 </para>
399
400 <itemizedlist>
401         <listitem><para>
402         Registers and advertises itself as a Domain Controller (through NetBIOS broadcasts
403         as well as by way of name registrations either by Mailslot Broadcasts over UDP broadcast,
404         to a WINS server over UDP unicast, or via DNS and Active Directory)
405         </para></listitem>
406
407         <listitem><para>
408         Provides the NETLOGON service (actually a collection of services that runs over
409         a number of protocols. These include the LanMan Logon service, the Netlogon service,
410         the Local Security Account service, and variations of them)
411         </para></listitem>
412
413         <listitem><para>
414         Provides a share called NETLOGON
415         </para></listitem>
416 </itemizedlist>
417
418 <para>
419 For Samba to provide these is rather easy to configure. Each Samba Domain Controller must provide
420 the NETLOGON service which Samba calls the <emphasis>domain logons</emphasis> functionality
421 (after the name of the parameter in the &smb.conf; file). Additionally, one (1) server in a Samba-3
422 Domain must advertise itself as the domain master browser. This causes the Primary Domain Controller
423 to claim domain specific NetBIOS name that identifies it as a domain master browser for its given
424 domain/workgroup. Local master browsers in the same domain/workgroup on broadcast-isolated subnets
425 then ask for a complete copy of the browse list for the whole wide area network. Browser clients
426 will then contact their local master browser, and will receive the domain-wide browse list,
427 instead of just the list for their broadcast-isolated subnet.
428 </para>
429
430 </sect2>
431 </sect1>
432
433 <sect1>
434 <title>Domain Control - Example Configuration</title>
435
436 <para>
437 The first step in creating a working Samba PDC is to understand the parameters necessary
438 in &smb.conf;. Here we attempt to explain the parameters that are covered in
439 the &smb.conf; man page.
440 </para>
441
442 <para>
443 Here is an example &smb.conf; for acting as a PDC:
444 </para>
445
446 <para><programlisting>
447         [global]
448             ; Basic server settings
449             <ulink url="smb.conf.5.html#NETBIOSNAME">netbios name</ulink> = <replaceable>POGO</replaceable>
450             <ulink url="smb.conf.5.html#WORKGROUP">workgroup</ulink> = <replaceable>NARNIA</replaceable>
451
452             ; User and Machine Account Backends
453             ; Choices are: tdbsam, smbpasswd, ldapsam, mysqlsam, xmlsam, guest
454             <ulink url="smb.conf.5.html#PASSDBBACKEND">passdb backend</ulink> = ldapsam, guest
455
456             ; we should act as the domain and local master browser
457             <ulink url="smb.conf.5.html#OSLEVEL">os level</ulink> = 64
458             <ulink url="smb.conf.5.html#PERFERREDMASTER">preferred master</ulink> = yes
459             <ulink url="smb.conf.5.html#DOMAINMASTER">domain master</ulink> = yes
460             <ulink url="smb.conf.5.html#LOCALMASTER">local master</ulink> = yes
461             
462             ; security settings (must user security = user)
463             <ulink url="smb.conf.5.html#SECURITYEQUALSUSER">security</ulink> = user
464             
465             ; encrypted passwords are a requirement for a PDC (default = Yes)
466             <ulink url="smb.conf.5.html#ENCRYPTPASSWORDS">encrypt passwords</ulink> = yes
467             
468             ; support domain logons
469             <ulink url="smb.conf.5.html#DOMAINLOGONS">domain logons</ulink> = yes
470             
471             ; where to store user profiles?
472             <ulink url="smb.conf.5.html#LOGONPATH">logon path</ulink> = \\%N\profiles\%u
473             
474             ; where is a user's home directory and where should it be mounted at?
475             <ulink url="smb.conf.5.html#LOGONDRIVE">logon drive</ulink> = H:
476             <ulink url="smb.conf.5.html#LOGONHOME">logon home</ulink> = \\homeserver\%u\winprofile
477             
478             ; specify a generic logon script for all users
479             ; this is a relative **DOS** path to the [netlogon] share
480             <ulink url="smb.conf.5.html#LOGONSCRIPT">logon script</ulink> = logon.cmd
481
482         ; necessary share for domain controller
483         [netlogon]
484             <ulink url="smb.conf.5.html#PATH">path</ulink> = /usr/local/samba/lib/netlogon
485             <ulink url="smb.conf.5.html#READONLY">read only</ulink> = yes
486             <ulink url="smb.conf.5.html#WRITELIST">write list</ulink> = <replaceable>ntadmin</replaceable>
487             
488         ; share for storing user profiles
489         [profiles]
490             <ulink url="smb.conf.5.html#PATH">path</ulink> = /export/smb/ntprofile
491             <ulink url="smb.conf.5.html#READONLY">read only</ulink> = no
492             <ulink url="smb.conf.5.html#CREATEMASK">create mask</ulink> = 0600
493             <ulink url="smb.conf.5.html#DIRECTORYMASK">directory mask</ulink> = 0700
494 </programlisting></para>
495
496 <note><para>
497 The above parameters make for a full set of parameters that may define the server's mode
498 of operation. The following parameters are the essentials alone:
499
500 <programlisting>
501         workgroup = NARNIA
502         domain logons = Yes
503         domain master = Yes
504         security = User
505 </programlisting>
506
507 The additional parameters shown in the longer listing above just makes for a
508 more complete environment.
509 </para></note>
510
511 <para>
512 There are a couple of points to emphasize in the above configuration.
513 </para>
514
515 <itemizedlist>
516         <listitem><para>
517         Encrypted passwords must be enabled.  For more details on how 
518         to do this, refer to <link linkend="passdb">Account Information Database chapter</link>.
519         </para></listitem>
520         
521         <listitem><para>
522         The server must support domain logons and have a
523         <parameter>[netlogon]</parameter> share
524         </para></listitem>
525         
526         <listitem><para>
527         The server must be the domain master browser in order for Windows 
528         client to locate the server as a DC.  Please refer to the various 
529         Network Browsing documentation included with this distribution for 
530         details.
531         </para></listitem>
532 </itemizedlist>    
533
534 </sect1>
535
536 <sect1>
537 <title>Samba ADS Domain Control</title>
538
539 <para>
540 Samba-3 is not and can not act as an Active Directory Server. It can not truly function as
541 an Active Directory Primary Domain Controller. The protocols for some of the functionality
542 the Active Directory Domain Controllers is have been partially implemented on an experimental
543 only basis. Please do NOT expect Samba-3 to support these protocols - nor should you depend
544 on any such functionality either now or in the future. The Samba-Team may well remove such
545 experimental features or may change their behaviour.
546 </para>
547
548 </sect1>
549
550 <sect1>
551 <title>Domain and Network Logon Configuration</title>
552
553 <para>
554 The subject of Network or Domain Logons is discussed here because it rightly forms
555 an integral part of the essential functionality that is provided by a Domain Controller.
556 </para>
557
558 <sect2>
559 <title>Domain Network Logon Service</title>
560
561 <para>
562 All Domain Controllers must run the netlogon service (<emphasis>domain logons</emphasis>
563 in Samba). One Domain Controller must be configured with <parameter>domain master = Yes</parameter>
564 (the Primary Domain Controller); on ALL Backup Domain Controllers <parameter>domain master = No</parameter>
565 must be set.
566 </para>
567
568 <sect3>
569 <title>Example Configuration</title>
570
571 <programlisting>
572         [global]
573                 domain logons = Yes
574                 domain master = (Yes on PDC, No on BDCs)
575
576         [netlogon]
577                 comment = Network Logon Service
578                 path = /var/lib/samba/netlogon
579                 guest ok = Yes
580                 browseable = No
581 </programlisting>
582
583 </sect3>
584 <sect3>
585 <title>The Special Case of MS Windows XP Home Edition</title>
586
587 <note><para>
588 MS Windows XP Home Edition does not have the ability to join any type of Domain
589 security facility. Unlike, MS Windows 9x / Me, MS Windows XP Home Edition also completely
590 lacks the ability to log onto a network.
591 </para></note>
592
593 <para>
594 To be completely clear: If you want MS Windows XP Home Edition to integrate with your
595 MS Windows NT4 or Active Directory Domain security understand - IT CAN NOT BE DONE.
596 Your only choice is to buy the upgrade pack from MS Windows XP Home Edition to
597 MS Windows XP Professional.
598 </para>
599
600 <para>
601 Now that this has been said, please do NOT ask the mailing list, or email any of the
602 Samba-Team members with your questions asking how to make this work. It can't be done.
603 </para>
604
605 </sect3>
606
607 <sect3>
608 <title>The Special Case of Windows 9x / Me</title>
609
610 <para>
611 A domain and a workgroup are exactly the same thing in terms of network
612 browsing.  The difference is that a distributable authentication
613 database is associated with a domain, for secure login access to a
614 network.  Also, different access rights can be granted to users if they
615 successfully authenticate against a domain logon server. Samba-3 does this
616 now in the same way that MS Windows NT/2K.
617 </para>
618
619 <para>
620 The SMB client logging on to a domain has an expectation that every other
621 server in the domain should accept the same authentication information.
622 Network browsing functionality of domains and workgroups is identical and
623 is explained in this documentation under the browsing discussions.
624 It should be noted, that browsing is totally orthogonal to logon support.
625 </para>
626
627 <para>
628 Issues related to the single-logon network model are discussed in this
629 section.  Samba supports domain logons, network logon scripts, and user
630 profiles for MS Windows for workgroups and MS Windows 9X/ME clients
631 which are the focus of this section.
632 </para>
633
634 <para>
635 When an SMB client in a domain wishes to logon, it broadcasts requests for a
636 logon server.  The first one to reply gets the job, and validates its
637 password using whatever mechanism the Samba administrator has installed.
638 It is possible (but very stupid) to create a domain where the user
639 database is not shared between servers, i.e. they are effectively workgroup
640 servers advertising themselves as participating in a domain.  This
641 demonstrates how authentication is quite different from but closely
642 involved with domains.
643 </para>
644
645 <para>
646 Using these features you can make your clients verify their logon via
647 the Samba server; make clients run a batch file when they logon to
648 the network and download their preferences, desktop and start menu.
649 </para>
650
651 <para><emphasis>
652 MS Windows XP Home edition is NOT able to join a domain and does not permit
653 the use of domain logons.
654 </emphasis></para>
655
656 <para>
657 Before launching into the configuration instructions, it is 
658 worthwhile to look at how a Windows 9x/ME client performs a logon:
659 </para>
660
661 <orderedlist>
662 <listitem>
663         <para>
664         The client broadcasts (to the IP broadcast address of the subnet it is in)
665         a NetLogon request. This is sent to the NetBIOS name DOMAIN&lt;#1c&gt; at the
666         NetBIOS layer.  The client chooses the first response it receives, which
667         contains the NetBIOS name of the logon server to use in the format of 
668         <filename>\\SERVER</filename>.
669         </para>
670 </listitem>
671
672 <listitem>
673         <para>
674         The client then connects to that server, logs on (does an SMBsessetupX) and
675         then connects to the IPC$ share (using an SMBtconX).
676         </para>
677 </listitem>
678
679 <listitem>
680         <para>
681         The client then does a NetWkstaUserLogon request, which retrieves the name
682         of the user's logon script. 
683         </para>
684 </listitem>
685
686 <listitem>
687         <para>
688         The client then connects to the NetLogon share and searches for said script     
689         and if it is found and can be read, is retrieved and executed by the client.
690         After this, the client disconnects from the NetLogon share.
691         </para>
692 </listitem>
693
694 <listitem>
695         <para>
696         The client then sends a NetUserGetInfo request to the server, to retrieve
697         the user's home share, which is used to search for profiles. Since the
698         response to the NetUserGetInfo request does not contain much more than  
699         the user's home share, profiles for Win9X clients MUST reside in the user
700         home directory.
701         </para>
702 </listitem>
703
704 <listitem>
705         <para>
706         The client then connects to the user's home share and searches for the 
707         user's profile. As it turns out, you can specify the user's home share as
708         a sharename and path. For example, <filename>\\server\fred\.winprofile</filename>.
709         If the profiles are found, they are implemented.
710         </para>
711 </listitem>
712
713 <listitem>
714         <para>
715         The client then disconnects from the user's home share, and reconnects to
716         the NetLogon share and looks for <filename>CONFIG.POL</filename>, the policies file. If this is
717         found, it is read and implemented.
718         </para>
719 </listitem>
720 </orderedlist>
721
722 <para>
723 The main difference between a PDC and a Windows 9x logon server configuration is that
724 </para>
725
726 <itemizedlist>
727 <listitem><para>
728         Password encryption is not required for a Windows 9x logon server. But note
729         that beginning with MS Windows 98 the default setting is that plain-text
730         password support has been disabled. It can be re-enabled with the registry
731         changes that are documented in the chapter on Policies.
732         </para></listitem>
733
734         <listitem><para>
735         Windows 9x/ME clients do not require and do not use machine trust accounts.
736         </para></listitem>
737 </itemizedlist>
738
739 <para>
740 A Samba PDC will act as a Windows 9x logon server; after all, it does provide the
741 network logon services that MS Windows 9x / Me expect to find.
742 </para>
743
744 </sect3>
745 </sect2>
746
747 <sect2>
748 <title>Security Mode and Master Browsers</title>
749
750 <para>
751 There are a few comments to make in order to tie up some 
752 loose ends.  There has been much debate over the issue of whether
753 or not it is ok to configure Samba as a Domain Controller in security
754 modes other than <constant>USER</constant>.  The only security mode 
755 which  will not work due to technical reasons is <constant>SHARE</constant>
756 mode security.  <constant>DOMAIN</constant> and <constant>SERVER</constant>
757 mode security are really just a variation on SMB user level security.
758 </para>
759
760 <para>
761 Actually, this issue is also closely tied to the debate on whether 
762 or not Samba must be the domain master browser for its workgroup
763 when operating as a DC.  While it may technically be possible
764 to configure a server as such (after all, browsing and domain logons
765 are two distinctly different functions), it is not a good idea to do
766 so.  You should remember that the DC must register the DOMAIN&lt;#1b&gt; NetBIOS 
767 name.  This is the name used by Windows clients to locate the DC.
768 Windows clients do not distinguish between the DC and the DMB.
769 For this reason, it is very wise to configure the Samba DC as the DMB.
770 </para>
771
772 <para>
773 Now back to the issue of configuring a Samba DC to use a mode other
774 than <parameter>security = user</parameter>.  If a Samba host is configured to use 
775 another SMB server or DC in order to validate user connection 
776 requests, then it is a fact that some other machine on the network 
777 (the <parameter>password server</parameter>) knows more about the user than the Samba host.
778 99% of the time, this other host is a domain controller.  Now 
779 in order to operate in domain mode security, the <parameter>workgroup</parameter> parameter
780 must be set to the name of the Windows NT domain (which already 
781 has a domain controller). If the domain does NOT already have a Domain Controller
782 then you do not yet have a Domain!
783 </para>
784
785 <para>
786 Configuring a Samba box as a DC for a domain that already by definition has a
787 PDC is asking for trouble. Therefore, you should always configure the Samba DC
788 to be the DMB for its domain and set <parameter>security = user</parameter>.
789 This is the only officially supported mode of operation.
790 </para>
791
792 </sect2>
793
794 </sect1>
795
796 <sect1>
797 <title>Common Problems and Errors</title>
798
799 <sect2>
800 <title>I cannot include a '$' in a machine name</title>
801 <para>
802 A 'machine account', (typically) stored in <filename>/etc/passwd</filename>,
803 takes the form of the machine name with a '$' appended. FreeBSD (and other BSD 
804 systems?) won't create a user with a '$' in their name.
805 </para>
806
807 <para>
808 The problem is only in the program used to make the entry. Once made, it works perfectly.
809 Create a user without the '$'. Then use <command>vipw</command> to edit the entry, adding
810 the '$'. Or create the whole entry with vipw if you like; make sure you use a unique User ID!
811 </para>
812 </sect2>
813
814 <sect2>
815 <title>I get told "You already have a connection to the Domain...." 
816 or "Cannot join domain, the credentials supplied conflict with an 
817 existing set.." when creating a machine trust account.</title>
818
819 <para>
820 This happens if you try to create a machine trust account from the 
821 machine itself and already have a connection (e.g. mapped drive) 
822 to a share (or IPC$) on the Samba PDC.  The following command
823 will remove all network drive connections:
824 </para>
825
826 <screen>
827         <prompt>C:\WINNT\></prompt> <userinput>net use * /d</userinput>
828 </screen>
829
830 <para>
831 Further, if the machine is already a 'member of a workgroup' that 
832 is the same name as the domain you are joining (bad idea) you will 
833 get this message.  Change the workgroup name to something else, it 
834 does not matter what, reboot, and try again.
835 </para>
836 </sect2>
837
838 <sect2>
839 <title>The system can not log you on (C000019B)....</title>
840
841 <para>I joined the domain successfully but after upgrading 
842 to a newer version of the Samba code I get the message, <errorname>The system 
843 can not log you on (C000019B), Please try again or consult your 
844 system administrator</errorname> when attempting to logon.
845 </para>
846
847 <para>
848 This occurs when the domain SID stored in the secrets.tdb database
849 is changed. The most common cause of a change in domain SID is when
850 the domain name and/or the server name (NetBIOS name) is changed.
851 The only way to correct the problem is to restore the original domain 
852 SID or remove the domain client from the domain and rejoin. The domain
853 SID may be reset using either the net or rpcclient utilities.
854 </para>
855
856 <para>
857 The reset or change the domain SID you can use the net command as follows:
858
859 <screen>
860 &rootprompt;<userinput>net getlocalsid 'OLDNAME'</userinput>
861 &rootprompt;<userinput>net setlocalsid 'SID'</userinput>
862 </screen>
863 </para>
864
865 </sect2>
866
867 <sect2>
868 <title>The machine trust account for this computer either does not 
869 exist or is not accessible.</title>
870
871 <para>
872 When I try to join the domain I get the message <errorname>The machine account 
873 for this computer either does not exist or is not accessible</errorname>. What's 
874 wrong?
875 </para>
876
877 <para>
878 This problem is caused by the PDC not having a suitable machine trust account. 
879 If you are using the <parameter>add machine script</parameter> method to create 
880 accounts then this would indicate that it has not worked. Ensure the domain 
881 admin user system is working.
882 </para>
883
884 <para>
885 Alternatively if you are creating account entries manually then they 
886 have not been created correctly. Make sure that you have the entry 
887 correct for the machine trust account in <filename>smbpasswd</filename> file on the Samba PDC. 
888 If you added the account using an editor rather than using the smbpasswd 
889 utility, make sure that the account name is the machine NetBIOS name 
890 with a '$' appended to it ( i.e. computer_name$ ). There must be an entry 
891 in both /etc/passwd and the smbpasswd file.
892 </para>
893
894 <para>
895 Some people have also reported 
896 that inconsistent subnet masks between the Samba server and the NT 
897 client can cause this problem.   Make sure that these are consistent 
898 for both client and server.
899 </para>
900 </sect2>
901
902 <sect2>
903 <title>When I attempt to login to a Samba Domain from a NT4/W2K workstation,
904 I get a message about my account being disabled.</title>
905
906 <para>
907 Enable the user accounts with <userinput>smbpasswd -e <replaceable>username</replaceable>
908 </userinput>, this is normally done as an account is created.
909 </para>
910
911 </sect2>
912
913 <sect2>
914         <title>Until a few minutes after Samba has started, clients get the error "Domain Controller Unavailable"</title>
915         <para>
916                 A domain controller has to announce on the network who it is. This usually takes a while.
917         </para>
918 </sect2>
919
920 </sect1>
921 </chapter>