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