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