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