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