A lot of syntax updates, consistency when using certain tags and converting ASCII...
[samba.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 <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 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 <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 Domain Membership
94 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 Manangement
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 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 a chapter dedicated to this topic..
159 </para>
160
161 <para>
162 A 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>passwd.tdb</emphasis>. The key benefit of this binary format
182         file is that it can store binary objects that can not be accomodated
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 mirgrating 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 the <link linkend="passdb">User 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 that 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 domaines it is the PDC seeds the Domain Control database,
251 a part of the Windows registry called the SAM (Security Accounts Management). 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 hierachy 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 the 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 PDB 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 vica 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 protcols 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 duely 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 groupped together. Again, just to be clear: <strong>workgroup mode does not involve any security machine 
335 accounts</strong>.
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 to the chapter
350 on Domain Membership for information regarding HOW to make your MS Windows clients Domain members.
351 </para></note>
352
353 <para>
354 The following are necessary for configuring Samba-3 as an MS Windows NT4 style PDC for MS Windows
355 NT4 / 200x / XP clients.
356 </para>
357
358 <simplelist>
359         <member>Configuration of basic TCP/IP and MS Windows Networking</member>
360         <member>Correct designation of the Server Role (<parameter>security = user</parameter>)</member>
361         <member>Consistent configuration of Name Resolution (See <link linkend="NetworkBrowsing">chapter on Browsing</link> and on
362         <link linkend="integrate-ms-networks">MS Windows network Integration</link>)</member>
363         <member>Domain logons for Windows NT4 / 200x / XP Professional clients</member>
364         <member>Configuration of Roaming Profiles or explicit configuration to force local profile usage</member>
365         <member>Configuration of Network/System Policies</member>
366         <member>Adding and managing domain user accounts</member>
367         <member>Configuring MS Windows client machines to become domain members</member>
368 </simplelist>
369
370 <para>
371 The following provisions are required to serve MS Windows 9x / Me Clients:
372 </para>
373
374 <simplelist>
375         <member>Configuration of basic TCP/IP and MS Windows Networking</member>
376         <member>Correct designation of the Server Role (<parameter>security = user</parameter>)</member>
377         <member>Network Logon Configuration (Since Windows 9x / XP Home are not technically domain
378         members, they do not really particpate in  the security aspects of Domain logons as such)</member>
379         <member>Roaming Profile Configuration</member>
380         <member>Configuration of System Policy handling</member>
381         <member>Installation of the Network driver "Client for MS Windows Networks" and configuration
382         to log onto the domain</member>
383         <member>Placing Windows 9x / Me clients in user level security - if it is desired to allow
384         all client share access to be controlled according to domain user / group identities.</member>
385         <member>Adding and managing domain user accounts</member>
386 </simplelist>
387
388 <note><para>
389 Roaming Profiles and System/Network policies are advanced network administration topics
390 that are covered separately in this document.  However, these are not necessarily specific
391 to a Samba PDC as much as they are related to Windows NT networking concepts.
392 </para></note>
393
394 <para>
395 A Domain Controller is an SMB/CIFS server that:
396 </para>
397
398 <itemizedlist>
399         <listitem><para>
400         Advertises and registers itself as a Domain Controller (Through NetBIOS broadcasts
401         as well as by way of name registrations either by Mailslot Broadcasts over UDP broadcast,
402         to a WINS server over UDP unicast, or via DNS and Active Directory)
403         </para></listitem>
404
405         <listitem><para>
406         Provides the NETLOGON service (actually a collection of services that runs over
407         a number of protocols. These include the LanMan Logon service, the Netlogon service,
408         the Local Security Account service, and variations of them)
409         </para></listitem>
410
411         <listitem><para>
412         Provides a share called NETLOGON
413         </para></listitem>
414 </itemizedlist>
415
416 <para>
417 For samba to provide these is rather easy to configure. Each Samba Domain Controller must provide
418 the NETLOGON service which samba calls the <emphasis>domain logons</emphasis> functionality
419 (after the name of the parameter in the &smb.conf; file). Additionally, one (1) server in a Samba-3
420 Domain must advertise itself as the domain master browser. This causes the Primary Domain Controller
421 to claim domain specific NetBIOS name that identifies it as a domain master browser for its given
422 domain/workgroup. Local master browsers in the same domain/workgroup on broadcast-isolated subnets
423 then ask for a complete copy of the browse list for the whole wide area network. Browser clients
424 will then contact their local master browser, and will receive the domain-wide browse list,
425 instead of just the list for their broadcast-isolated subnet.
426 </para>
427
428 </sect2>
429 </sect1>
430
431 <sect1>
432 <title>Domain Control - Example Configuration</title>
433
434 <para>
435 The first step in creating a working Samba PDC is to understand the parameters necessary
436 in &smb.conf;. Here we attempt to explain the parameters that are covered in
437 the &smb.conf; man page.
438 </para>
439
440 <para>
441 Here is an example &smb.conf; for acting as a PDC:
442 </para>
443
444 <para><programlisting>
445         [global]
446             ; Basic server settings
447             <ulink url="smb.conf.5.html#NETBIOSNAME">netbios name</ulink> = <replaceable>POGO</replaceable>
448             <ulink url="smb.conf.5.html#WORKGROUP">workgroup</ulink> = <replaceable>NARNIA</replaceable>
449
450             ; User and Machine Account Backends
451             ; Choices are: tdbsam, smbpasswd, ldapsam, mysqlsam, xmlsam, guest
452             <ulink url="smb.conf.5.html#PASSDBBACKEND">passdb backend</ulink> = ldapsam, guest
453
454             ; we should act as the domain and local master browser
455             <ulink url="smb.conf.5.html#OSLEVEL">os level</ulink> = 64
456             <ulink url="smb.conf.5.html#PERFERREDMASTER">preferred master</ulink> = yes
457             <ulink url="smb.conf.5.html#DOMAINMASTER">domain master</ulink> = yes
458             <ulink url="smb.conf.5.html#LOCALMASTER">local master</ulink> = yes
459             
460             ; security settings (must user security = user)
461             <ulink url="smb.conf.5.html#SECURITYEQUALSUSER">security</ulink> = user
462             
463             ; encrypted passwords are a requirement for a PDC (default = Yes)
464             <ulink url="smb.conf.5.html#ENCRYPTPASSWORDS">encrypt passwords</ulink> = yes
465             
466             ; support domain logons
467             <ulink url="smb.conf.5.html#DOMAINLOGONS">domain logons</ulink> = yes
468             
469             ; where to store user profiles?
470             <ulink url="smb.conf.5.html#LOGONPATH">logon path</ulink> = \\%N\profiles\%u
471             
472             ; where is a user's home directory and where should it be mounted at?
473             <ulink url="smb.conf.5.html#LOGONDRIVE">logon drive</ulink> = H:
474             <ulink url="smb.conf.5.html#LOGONHOME">logon home</ulink> = \\homeserver\%u\winprofile
475             
476             ; specify a generic logon script for all users
477             ; this is a relative **DOS** path to the [netlogon] share
478             <ulink url="smb.conf.5.html#LOGONSCRIPT">logon script</ulink> = logon.cmd
479
480         ; necessary share for domain controller
481         [netlogon]
482             <ulink url="smb.conf.5.html#PATH">path</ulink> = /usr/local/samba/lib/netlogon
483             <ulink url="smb.conf.5.html#READONLY">read only</ulink> = yes
484             <ulink url="smb.conf.5.html#WRITELIST">write list</ulink> = <replaceable>ntadmin</replaceable>
485             
486         ; share for storing user profiles
487         [profiles]
488             <ulink url="smb.conf.5.html#PATH">path</ulink> = /export/smb/ntprofile
489             <ulink url="smb.conf.5.html#READONLY">read only</ulink> = no
490             <ulink url="smb.conf.5.html#CREATEMASK">create mask</ulink> = 0600
491             <ulink url="smb.conf.5.html#DIRECTORYMASK">directory mask</ulink> = 0700
492 </programlisting></para>
493
494 <note><para>
495 The above parameters make for a full set of parameters that may define the server's mode
496 of operation. The following parameters are the essentials alone:
497
498 <programlisting>
499         workgroup = NARNIA
500         domain logons = Yes
501         domain master = Yes
502         security = User
503 </programlisting>
504
505 The additional parameters shown in the longer listing above just makes for a
506 more complete environment.
507 </para></note>
508
509 <para>
510 There are a couple of points to emphasize in the above configuration.
511 </para>
512
513 <itemizedlist>
514         <listitem><para>
515         Encrypted passwords must be enabled.  For more details on how 
516         to do this, refer to <link linkend="passdb">the User Database chapter</link>.
517         </para></listitem>
518         
519         <listitem><para>
520         The server must support domain logons and have a
521         <parameter>[netlogon]</parameter> share
522         </para></listitem>
523         
524         <listitem><para>
525         The server must be the domain master browser in order for Windows 
526         client to locate the server as a DC.  Please refer to the various 
527         Network Browsing documentation included with this distribution for 
528         details.
529         </para></listitem>
530 </itemizedlist>    
531
532 </sect1>
533
534 <sect1>
535 <title>Samba ADS Domain Control</title>
536
537 <para>
538 Samba-3 is not and can not act as an Active Directory Server. It can not truely function as
539 an Active Directory Primary Domain Controller. The protocols for some of the functionality
540 the Active Directory Domain Controllers is have been partially implemented on an experiemental
541 only basis. Please do NOT expect Samba-3 to support these protocols - nor should you depend
542 on any such functionality either now or in the future. The Samba-Team may well remove such
543 experiemental features or may change their behaviour.
544 </para>
545
546 </sect1>
547
548 <sect1>
549 <title>Domain and Network Logon Configuration</title>
550
551 <para>
552 The subject of Network or Domain Logons is discussed here because it rightly forms
553 an integral part of the essential functionality that is provided by a Domain Controller.
554 </para>
555
556 <sect2>
557 <title>Domain Network Logon Service</title>
558
559 <para>
560 All Domain Controllers must run the netlogon service (<emphasis>domain logons</emphasis>
561 in Samba. One Domain Controller must be configured with <parameter>domain master = Yes</parameter>
562 (the Primary Domain Controller), on ALL Backup Domain Controllers <parameter>domain master = No</parameter>
563 must be set.
564 </para>
565
566 <sect3>
567 <title>Example Configuration</title>
568
569 <programlisting>
570         [globals]
571                 domain logons = Yes
572                 domain master = (Yes on PDC, No on BDCs)
573
574         [netlogon]
575                 comment = Network Logon Service
576                 path = /var/lib/samba/netlogon
577                 guest ok = Yes
578                 browseable = No
579 </programlisting>
580
581 </sect3>
582 <sect3>
583 <title>The Special Case of MS Windows XP Home Edition</title>
584
585 <note><para>
586 MS Windows XP Home Edition does not have the ability to join any type of Domain
587 security facility. Unlike, MS Windows 9x / Me, MS Windows XP Home Edition also completely
588 lacks the ability to log onto a network.
589 </para></note>
590
591 <para>
592 To be completely clear: If you want MS Windows XP Home Edition to integrate with your
593 MS Windows NT4 or Active Directory Domain security understand - IT CAN NOT BE DONE.
594 Your only choice is to buy the upgrade pack from MS Windows XP Home Edition to
595 MS Windows XP Professional.
596 </para>
597
598 <para>
599 Now that this has been said, please do NOT ask the mailing list, or email any of the
600 Samba-Team members with your questions asking how to make this work. It can't be done.
601 </para>
602
603 </sect3>
604
605 <sect3>
606 <title>The Special Case of Windows 9x / Me</title>
607
608 <para>
609 A domain and a workgroup are exactly the same thing in terms of network
610 browsing.  The difference is that a distributable authentication
611 database is associated with a domain, for secure login access to a
612 network.  Also, different access rights can be granted to users if they
613 successfully authenticate against a domain logon server. Samba-3 does this
614 now in the same way that MS Windows NT/2K.
615 </para>
616
617 <para>
618 The SMB client logging on to a domain has an expectation that every other
619 server in the domain should accept the same authentication information.
620 Network browsing functionality of domains and workgroups is identical and
621 is explained in this documentation under the browsing discussions.
622 It should be noted, that browsing is totally orthogonal to logon support.
623 </para>
624
625 <para>
626 Issues related to the single-logon network model are discussed in this
627 section.  Samba supports domain logons, network logon scripts, and user
628 profiles for MS Windows for workgroups and MS Windows 9X/ME clients
629 which are the focus of this section.
630 </para>
631
632 <para>
633 When an SMB client in a domain wishes to logon it broadcast requests for a
634 logon server.  The first one to reply gets the job, and validates its
635 password using whatever mechanism the Samba administrator has installed.
636 It is possible (but very stupid) to create a domain where the user
637 database is not shared between servers, i.e. they are effectively workgroup
638 servers advertising themselves as participating in a domain.  This
639 demonstrates how authentication is quite different from but closely
640 involved with domains.
641 </para>
642
643 <para>
644 Using these features you can make your clients verify their logon via
645 the Samba server; make clients run a batch file when they logon to
646 the network and download their preferences, desktop and start menu.
647 </para>
648
649 <para><emphasis>
650 MS Windows XP Home edition is NOT able to join a domain and does not permit
651 the use of domain logons.
652 </emphasis></para>
653
654 <para>
655 Before launching into the configuration instructions, it is 
656 worthwhile to look at how a Windows 9x/ME client performs a logon:
657 </para>
658
659 <orderedlist>
660 <listitem>
661         <para>
662         The client broadcasts (to the IP broadcast address of the subnet it is in)
663         a NetLogon request. This is sent to the NetBIOS name DOMAIN&lt;#1c&gt; at the
664         NetBIOS layer.  The client chooses the first response it receives, which
665         contains the NetBIOS name of the logon server to use in the format of 
666         <filename>\\SERVER</filename>.
667         </para>
668 </listitem>
669
670 <listitem>
671         <para>
672         The client then connects to that server, logs on (does an SMBsessetupX) and
673         then connects to the IPC$ share (using an SMBtconX).
674         </para>
675 </listitem>
676
677 <listitem>
678         <para>
679         The client then does a NetWkstaUserLogon request, which retrieves the name
680         of the user's logon script. 
681         </para>
682 </listitem>
683
684 <listitem>
685         <para>
686         The client then connects to the NetLogon share and searches for this    
687         and if it is found and can be read, is retrieved and executed by the client.
688         After this, the client disconnects from the NetLogon share.
689         </para>
690 </listitem>
691
692 <listitem>
693         <para>
694         The client then sends a NetUserGetInfo request to the server, to retrieve
695         the user's home share, which is used to search for profiles. Since the
696         response to the NetUserGetInfo request does not contain much more then  
697         the user's home share, profiles for Win9X clients MUST reside in the user
698         home directory.
699         </para>
700 </listitem>
701
702 <listitem>
703         <para>
704         The client then connects to the user's home share and searches for the 
705         user's profile. As it turns out, you can specify the user's home share as
706         a sharename and path. For example, <filename>\\server\fred\.winprofile</filename>.
707         If the profiles are found, they are implemented.
708         </para>
709 </listitem>
710
711 <listitem>
712         <para>
713         The client then disconnects from the user's home share, and reconnects to
714         the NetLogon share and looks for <filename>CONFIG.POL</filename>, the policies file. If this is
715         found, it is read and implemented.
716         </para>
717 </listitem>
718 </orderedlist>
719
720 <para>
721 The main difference between a PDC and a Windows 9x logon server configuration is that
722 </para>
723
724 <itemizedlist>
725 <listitem><para>
726         Password encryption is not required for a Windows 9x logon server. But note
727         that beginning with MS Windows 98 the default setting is that plain-text
728         password support has been disabled. It can be re-enabled with the registry
729         changes that are documented in the chapter on Policies.
730         </para></listitem>
731
732         <listitem><para>
733         Windows 9x/ME clients do not require and do not use machine trust accounts.
734         </para></listitem>
735 </itemizedlist>
736
737 <para>
738 A Samba PDC will act as a Windows 9x logon server, after all it does provide the
739 network logon services that MS Windows 9x / Me expect to find.
740 </para>
741
742 </sect3>
743 </sect2>
744
745 <sect2>
746 <title>Security Mode and Master Browsers</title>
747
748 <para>
749 There are a few comments to make in order to tie up some 
750 loose ends.  There has been much debate over the issue of whether
751 or not it is ok to configure Samba as a Domain Controller in security
752 modes other than <constant>USER</constant>.  The only security mode 
753 which  will not work due to technical reasons is <constant>SHARE</constant>
754 mode security.  <constant>DOMAIN</constant> and <constant>SERVER</constant>
755 mode security are really just a variation on SMB user level security.
756 </para>
757
758 <para>
759 Actually, this issue is also closely tied to the debate on whether 
760 or not Samba must be the domain master browser for its workgroup
761 when operating as a DC.  While it may technically be possible
762 to configure a server as such (after all, browsing and domain logons
763 are two distinctly different functions), it is not a good idea to do
764 so.  You should remember that the DC must register the DOMAIN&lt;#1b&gt; NetBIOS 
765 name.  This is the name used by Windows clients to locate the DC.
766 Windows clients do not distinguish between the DC and the DMB.
767 For this reason, it is very wise to configure the Samba DC as the DMB.
768 </para>
769
770 <para>
771 Now back to the issue of configuring a Samba DC to use a mode other
772 than <parameter>security = user</parameter>.  If a Samba host is configured to use 
773 another SMB server or DC in order to validate user connection 
774 requests, then it is a fact that some other machine on the network 
775 (the <parameter>password server</parameter>) knows more about the user than the Samba host.
776 99% of the time, this other host is a domain controller.  Now 
777 in order to operate in domain mode security, the <parameter>workgroup</parameter> parameter
778 must be set to the name of the Windows NT domain (which already 
779 has a domain controller). If the domain does NOT already have a Domain Controller
780 then you do not yet have a Domain!
781 </para>
782
783 <para>
784 Configuring a Samba box as a DC for a domain that already by definition has a
785 PDC is asking for trouble. Therefore, you should always configure the Samba DC
786 to be the DMB for its domain and set <parameter>security = user</parameter>.
787 This is the only officially supported mode of operation.
788 </para>
789
790 </sect2>
791
792 </sect1>
793
794 <sect1>
795 <title>Common Problems and Errors</title>
796
797 <sect2>
798 <title>I cannot include a '$' in a machine name</title>
799 <para>
800 A 'machine name' in (typically) <filename>/etc/passwd</filename>        
801 of the machine name with a '$' appended. FreeBSD (and other BSD 
802 systems?) won't create a user with a '$' in their name.
803 </para>
804
805 <para>
806 The problem is only in the program used to make the entry. Once made, it works perfectly.
807 Create a user without the '$' using <command>vipw</command> to edit the entry, adding
808 the '$'. Or create the whole entry with vipw if you like, make sure you use a unique User ID!
809 </para>
810 </sect2>
811
812 <sect2>
813 <title>I get told "You already have a connection to the Domain...." 
814 or "Cannot join domain, the credentials supplied conflict with an 
815 existing set.." when creating a machine trust account.</title>
816
817 <para>
818 This happens if you try to create a machine trust account from the 
819 machine itself and already have a connection (e.g. mapped drive) 
820 to a share (or IPC$) on the Samba PDC.  The following command
821 will remove all network drive connections:
822 </para>
823
824 <screen>
825         <prompt>C:\WINNT\></prompt> <userinput>net use * /d</userinput>
826 </screen>
827
828 <para>
829 Further, if the machine is already a 'member of a workgroup' that 
830 is the same name as the domain you are joining (bad idea) you will 
831 get this message.  Change the workgroup name to something else, it 
832 does not matter what, reboot, and try again.
833 </para>
834 </sect2>
835
836 <sect2>
837 <title>The system can not log you on (C000019B)....</title>
838
839 <para>I joined the domain successfully but after upgrading 
840 to a newer version of the Samba code I get the message, <errorname>The system 
841 can not log you on (C000019B), Please try again or consult your 
842 system administrator</errorname> when attempting to logon.
843 </para>
844
845 <para>
846 This occurs when the domain SID stored in the secrets.tdb database
847 is changed. The most common cause of a change in domain SID is when
848 the domain name and/or the server name (netbios name) is changed.
849 The only way to correct the problem is to restore the original domain 
850 SID or remove the domain client from the domain and rejoin. The domain
851 SID may be reset using either the net or rpcclient utilities.
852 </para>
853
854 <para>
855 The reset or change the domain SID you can use the net command as follows:
856
857 <screen>
858 <prompt>$ </prompt><userinput>net getlocalsid 'OLDNAME'</userinput>
859 <prompt>$ </prompt><userinput>net setlocalsid 'SID'</userinput>
860 </screen>
861 </para>
862
863 </sect2>
864
865 <sect2>
866 <title>The machine trust account for this computer either does not 
867 exist or is not accessible.</title>
868
869 <para>
870 When I try to join the domain I get the message <errorname>The machine account 
871 for this computer either does not exist or is not accessible</errorname>. What's 
872 wrong?
873 </para>
874
875 <para>
876 This problem is caused by the PDC not having a suitable machine trust account. 
877 If you are using the <parameter>add machine script</parameter> method to create 
878 accounts then this would indicate that it has not worked. Ensure the domain 
879 admin user system is working.
880 </para>
881
882 <para>
883 Alternatively if you are creating account entries manually then they 
884 have not been created correctly. Make sure that you have the entry 
885 correct for the machine trust account in smbpasswd file on the Samba PDC. 
886 If you added the account using an editor rather than using the smbpasswd 
887 utility, make sure that the account name is the machine NetBIOS name 
888 with a '$' appended to it ( i.e. computer_name$ ). There must be an entry 
889 in both /etc/passwd and the smbpasswd file. Some people have reported 
890 that inconsistent subnet masks between the Samba server and the NT 
891 client have caused this problem.   Make sure that these are consistent 
892 for both client and server.
893 </para>
894 </sect2>
895
896 <sect2>
897 <title>When I attempt to login to a Samba Domain from a NT4/W2K workstation,
898 I get a message about my account being disabled.</title>
899
900 <para>
901 At first be ensure to enable the useraccounts with <userinput>smbpasswd -e 
902 <replaceable>username</replaceable></userinput>, this is normally done, when you create an account.
903 </para>
904
905 </sect2>
906 </sect1>
907 </chapter>