1 <chapter id="samba-pdc">
7 <author>&person.gd; <contrib>LDAP updates</contrib></author>
10 <title>Domain Control</title>
13 There are many who approach MS Windows networking with incredible misconceptions.
14 That's okay, because it gives the rest of us plenty of opportunity to be of assistance.
15 Those who really want help would be well advised to become familiar with information
16 that is already available.
20 The reader is advised not to tackle this section without having first understood
21 and mastered some basics. MS Windows networking is not particularly forgiving of
22 misconfiguration. Users of MS Windows networking are likely to complain
23 of persistent niggles that may be caused by a broken network configuration.
24 To a great many people, however, MS Windows networking starts with a Domain Controller
25 that in some magical way is expected to solve all network operational ills.
29 The diagram in <link linkend="domain-example"/> shows a typical MS Windows Domain Security
30 network environment. Workstations A, B and C are representative of many physical MS Windows
34 <figure id="domain-example"><title>An Example Domain.</title>
36 <imageobject role="latex"><imagedata fileref="projdoc/imagefiles/domain" width="4in" scalefit="1"/></imageobject>
37 <imageobject><imagedata fileref="projdoc/imagefiles/domain.png" scale="50" scalefit="1"/></imageobject>
45 From the Samba mailing list one can readily identify many common networking issues.
46 If you are not clear on the following subjects, then it will do much good to read the
47 sections of this HOWTO that deal with it. These are the most common causes of MS Windows
52 <listitem><para>Basic TCP/IP configuration.</para></listitem>
53 <listitem><para>NetBIOS name resolution.</para></listitem>
54 <listitem><para>Authentication configuration.</para></listitem>
55 <listitem><para>User and group configuration.</para></listitem>
56 <listitem><para>Basic file and directory permission control in UNIX/Linux.</para></listitem>
57 <listitem><para>Understanding how MS Windows clients interoperate in a network
58 environment.</para></listitem>
62 Do not be put off; on the surface of it MS Windows networking seems so simple that anyone
63 can do it. In fact, it is not a good idea to set up an MS Windows network with
64 inadequate training and preparation. But let's get our first indelible principle out of the
65 way: <emphasis>It is perfectly okay to make mistakes!</emphasis> In the right place and at
66 the right time, mistakes are the essence of learning. It is very much not okay to make
67 mistakes that cause loss of productivity and impose an avoidable financial burden on an
72 Where is the right place to make mistakes? Only out of harm's way. If you are going to
73 make mistakes, then please do it on a test network, away from users and in such a way as
74 to not inflict pain on others. Do your learning on a test network.
78 <title>Features and Benefits</title>
81 <indexterm><primary>domain security</primary></indexterm>
82 <emphasis>What is the key benefit of Microsoft Domain Security?</emphasis>
86 In a word, <emphasis>Single Sign On</emphasis>, or SSO for short. To many, this is the Holy
87 Grail of MS Windows NT and beyond networking. SSO allows users in a well-designed network
88 to log onto any workstation that is a member of the domain that their user account is in
89 (or in a domain that has an appropriate trust relationship with the domain they are visiting)
90 and they will be able to log onto the network and access resources (shares, files and printers)
91 as if they are sitting at their home (personal) workstation. This is a feature of the Domain
96 <indexterm><primary>SID</primary></indexterm>
97 The benefits of Domain Security are available to those sites that deploy a Samba PDC.
98 A Domain provides a unique network security identifier (SID). Domain user and group security
99 identifiers are comprised of the network SID plus a relative identifier (RID) that is unique to
100 the account. User and Group SIDs (the network SID plus the RID) can be used to create Access Control
101 Lists (ACLs) attached to network resources to provide organizational access control. UNIX systems
102 recognize only local security identifiers.
106 Network clients of an MS Windows Domain Security Environment must be Domain Members to be
107 able to gain access to the advanced features provided. Domain Membership involves more than just
108 setting the workgroup name to the Domain name. It requires the creation of a Domain trust account
109 for the workstation (called a machine account). Refer to <link linkend="domain-member"></link>
110 for more information.
114 The following functionalities are new to the Samba-3 release:
119 Windows NT4 domain trusts.
123 <indexterm><primary>Nexus.exe</primary></indexterm>
124 Adding users via the User Manager for Domains. This can be done on any MS Windows
125 client using the <filename>Nexus.exe</filename> toolkit that is available from Microsoft's Web site.
126 Samba-3 supports the use of the Microsoft Management Console for user management.
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.
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.
144 The following functionalities are not provided by Samba-3:
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.
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).
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.
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.
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"></link>.
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 datastore.
193 Refer to <link linkend="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"></link>.
201 <title>Basics of Domain Control</title>
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.
210 <title>Domain Controller Types</title>
213 <listitem><para>Primary Domain Controller</para></listitem>
214 <listitem><para>Backup Domain Controller</para></listitem>
215 <listitem><para>ADS Domain Controller</para></listitem>
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.
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.
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 downline controller has
240 control only over its downline. With Samba-3, this functionality can be implemented using an
241 LDAP-based user and machine account backend.
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"/>.</para></footnote>.
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.
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:
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>
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.
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.
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:
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>
307 <title>Preparing for Domain Control</title>
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.
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 configurationi, 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
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.
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"></link> for
339 information regarding Domain Membership.
343 The following are necessary for configuring Samba-3 as an MS Windows NT4-style PDC for MS Windows
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</name><value>user</value></smbconfoption>).</para></listitem>
350 <listitem><para>Consistent configuration of Name Resolution<footnote><para>See <link linkend="NetworkBrowsing"></link>, and
351 <link linkend="integrate-ms-networks"></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>
360 The following provisions are required to serve MS Windows 9x/Me clients:
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</name><value>user</value></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>
378 Roaming Profiles and System/Network policies are advanced network administration topics
379 that are covered in the <link linkend="ProfileMgmt"></link> and
380 <link linkend="PolicyMgmt"></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.
385 A Domain Controller is an SMB/CIFS server that:
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 unicast, or via DNS and Active Directory).
396 Provides the NETLOGON service. (This is actually a collection of services that runs over
397 mulitple protocols. These include the LanMan Logon service, the Netlogon service,
398 the Local Security Account service, and variations of them.)
402 Provides a share called NETLOGON.
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</name></smbconfoption> 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"/>.</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.
422 <title>Domain Control &smbmdash; Example Configuration</title>
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"/>.
430 <smbconfexample id="pdc-example">
431 <title>smb.conf for being a PDC</title>
432 <smbconfsection>[global]</smbconfsection>
433 <smbconfoption><name>netbios name</name><value><replaceable>BELERIAND</replaceable></value></smbconfoption>
434 <smbconfoption><name>workgroup</name><value><replaceable>&example.workgroup;</replaceable></value></smbconfoption>
435 <smbconfoption><name>passdb backend</name><value>tdbsam</value></smbconfoption>
436 <smbconfoption><name>os level</name><value>33</value></smbconfoption>
437 <smbconfoption><name>preferred master</name><value>yes</value></smbconfoption>
438 <smbconfoption><name>domain master</name><value>yes</value></smbconfoption>
439 <smbconfoption><name>local master</name><value>yes</value></smbconfoption>
440 <smbconfoption><name>security</name><value>user</value></smbconfoption>
441 <smbconfoption><name>domain logons</name><value>yes</value></smbconfoption>
442 <smbconfoption><name>logon path</name><value>\\%N\profiles\%u</value></smbconfoption>
443 <smbconfoption><name>logon drive</name><value>H:</value></smbconfoption>
444 <smbconfoption><name>logon home</name><value>\\homeserver\%u\winprofile</value></smbconfoption>
445 <smbconfoption><name>logon script</name><value>logon.cmd</value></smbconfoption>
447 <smbconfsection>[netlogon]</smbconfsection>
448 <smbconfoption><name>path</name><value>/var/lib/samba/netlogon</value></smbconfoption>
449 <smbconfoption><name>read only</name><value>yes</value></smbconfoption>
450 <smbconfoption><name>write list</name><value><replaceable>ntadmin</replaceable></value></smbconfoption>
452 <smbconfsection>[profiles]</smbconfsection>
453 <smbconfoption><name>path</name><value>/var/lib/samba/profiles</value></smbconfoption>
454 <smbconfoption><name>read only</name><value>no</value></smbconfoption>
455 <smbconfoption><name>create mask</name><value>0600</value></smbconfoption>
456 <smbconfoption><name>directory mask</name><value>0700</value></smbconfoption>
461 The basic options shown in <link linkend="pdc-example"/> are explained as follows:
465 <varlistentry><term>passdb backend </term>
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>
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.
477 <varlistentry><term>Domain Control Parameters </term>
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>
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"></link>.
491 <varlistentry><term>Environment Parameters </term>
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.
499 <varlistentry><term>NETLOGON Share </term>
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.
507 <varlistentry><term>PROFILE Share </term>
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.
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:
525 <smbconfoption><name>netbios name</name><value>BELERIAND</value></smbconfoption>
526 <smbconfoption><name>workgroup</name><value>&example.workgroup;</value></smbconfoption>
527 <smbconfoption><name>domain logons</name><value>Yes</value></smbconfoption>
528 <smbconfoption><name>domain master</name><value>Yes</value></smbconfoption>
529 <smbconfoption><name>security</name><value>User</value></smbconfoption>
534 The additional parameters shown in the longer listing above just makes for
535 a more complete explanation.
541 <title>Samba ADS Domain Control</title>
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!
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 contollers 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.
565 <title>Domain and Network Logon Configuration</title>
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.
573 <title>Domain Network Logon Service</title>
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</name><value>Yes</value></smbconfoption>
578 (the Primary Domain Controller); on all Backup Domain Controllers <smbconfoption><name>domain master</name><value>No</value></smbconfoption>
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</name><value>Yes</value></smbconfoption>
589 <smbconfoption><name>domain master</name><value>(Yes on PDC, No on BDCs)</value></smbconfoption>
591 <smbconfsection>[netlogon]</smbconfsection>
592 <smbconfoption><name>comment</name><value>Network Logon Service</value></smbconfoption>
593 <smbconfoption><name>path</name><value>/var/lib/samba/netlogon</value></smbconfoption>
594 <smbconfoption><name>guest ok</name><value>Yes</value></smbconfoption>
595 <smbconfoption><name>browseable</name><value>No</value></smbconfoption>
600 <title>The Special Case of MS Windows XP Home Edition</title>
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.
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.
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.
625 <title>The Special Case of Windows 9x/Me</title>
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.
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.
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.
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.
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.
669 MS Windows XP Home edition is not able to join a domain and does not permit
670 the use of domain logons.
674 Before launching into the configuration instructions, it is
675 worthwhile to look at how a Windows 9x/Me client performs a logon:
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<#1c> 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>.
691 The client connects to that server, logs on (does an SMBsessetupX) and
692 then connects to the IPC$ share (using an SMBtconX).
698 The client does a NetWkstaUserLogon request, which retrieves the name
699 of the user's logon script.
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.
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
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 sharename and path. For example, <filename>\\server\fred\.winprofile</filename>.
726 If the profiles are found, they are implemented.
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.
740 The main difference between a PDC and a Windows 9x/Me logon server configuration is:
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"/>.
752 Windows 9x/Me clients do not require and do not use Machine Trust Accounts.
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.
762 Use of plain-text passwords is strongly discouraged. Where used they are easily detected
763 using a sniffer tool to examine network traffic.
770 <title>Security Mode and Master Browsers</title>
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.
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<#1b> 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"></link>.
790 For this reason, it is wise to configure the Samba DC as the DMB.
794 Now back to the issue of configuring a Samba DC to use a mode other than
795 <smbconfoption><name>security</name><value>user</value></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</name></smbconfoption>)
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</name></smbconfoption>
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.
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</name><value>user</value></smbconfoption>.
808 This is the only officially supported mode of operation.
816 <title>Common Errors</title>
819 <title><quote>$</quote> Cannot Be Included in Machine Name</title>
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.
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.
832 <note><para>The machine account must have the exact name that the workstation has.</para></note>
835 The UNIX tool <command>vipw</command> is a common tool for directly editing the <filename>/etc/passwd</filename> file.
841 <title>Joining Domain Fails Because of Existing Machine Account</title>
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>
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:
853 &dosprompt;<userinput>net use * /d</userinput>
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.
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>
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.
885 To reset or change the domain SID you can use the net command as follows:
888 &rootprompt;<userinput>net getlocalsid 'OLDNAME'</userinput>
889 &rootprompt;<userinput>net setlocalsid 'SID'</userinput>
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
903 <title>The Machine Trust Account Is Not Accessible</title>
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
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</name></smbconfoption> method to create
914 accounts then this would indicate that it has not worked. Ensure the domain
915 admin user system is working.
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.
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.
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>
941 Enable the user accounts with <userinput>smbpasswd -e <replaceable>username</replaceable>
942 </userinput>. This is normally done as an account is created.
948 <title>Domain Controller Unavailable</title>
950 <para><quote>Until a few minutes after Samba has started, clients get the error `Domain Controller Unavailable'</quote></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,
959 <title>Cannot Log onto Domain Member Workstation After Joining Domain</title>
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>
972 <command>testparm -v | more</command> and looking for the value of these parameters.
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/Securty Options area and are prefixed by
979 <emphasis>Secure Channel: ..., and Digitally sign ....</emphasis>.
983 It is important that these be set consistently with the Samba-3 server settings.