1 <?xml version="1.0" encoding="iso-8859-1"?>
2 <!DOCTYPE chapter PUBLIC "-//Samba-Team//DTD DocBook V4.2-Based Variant V1.0//EN" "http://www.samba.org/samba/DTD/samba-doc">
3 <chapter id="domain-member">
11 <author>&person.gd;<contrib>LDAP updates</contrib></author>
14 <title>Domain Membership</title>
17 <indexterm><primary>domain member</primary></indexterm>
18 <indexterm><primary>machine trust account</primary></indexterm>
19 <indexterm><primary>domain security</primary></indexterm>
20 Domain membership is a subject of vital concern. Samba must be able to
21 participate as a member server in a Microsoft domain security context, and
22 Samba must be capable of providing domain machine member trust accounts;
23 otherwise it would not be able to offer a viable option for many users.
27 <indexterm><primary>domain membership</primary></indexterm>
28 <indexterm><primary>misinformation</primary></indexterm>
29 This chapter covers background information pertaining to domain membership,
30 the Samba configuration for it, and MS Windows client procedures for joining a
31 domain. Why is this necessary? Because both are areas in which there exists
32 within the current MS Windows networking world, and particularly in the
33 UNIX/Linux networking and administration world, a considerable level of
34 misinformation, incorrect understanding, and lack of knowledge. Hopefully
35 this chapter will fill the voids.
39 <title>Features and Benefits</title>
42 <indexterm><primary>domain security</primary></indexterm>
43 <indexterm><primary>single sign-on</primary></indexterm>
44 <indexterm><primary>SSO</primary></indexterm>
45 MS Windows workstations and servers that want to participate in domain security need to
46 be made domain members. Participating in domain security is often called
47 <emphasis>single sign-on</emphasis>, or <acronym>SSO</acronym> for short. This
48 chapter describes the process that must be followed to make a workstation
49 (or another server &smbmdash; be it an <application>MS Windows NT4/200x</application>
50 server) or a Samba server a member of an MS Windows domain security context.
54 <indexterm><primary>native member</primary></indexterm>
55 <indexterm><primary>ADS</primary></indexterm>
56 <indexterm><primary>domain control</primary></indexterm>
57 <indexterm><primary>Server Type</primary><secondary>Domain Member</secondary></indexterm>
58 Samba-3 can join an MS Windows NT4-style domain as a native member server, an
59 MS Windows Active Directory domain as a native member server, or a Samba domain
60 control network. Domain membership has many advantages:
65 <indexterm><primary>SAM</primary></indexterm>
66 MS Windows workstation users get the benefit of SSO.
70 <indexterm><primary>access rights</primary></indexterm>
71 <indexterm><primary>file ownership</primary></indexterm>
72 <indexterm><primary>access controls</primary></indexterm>
73 <indexterm><primary>SAM</primary></indexterm>
74 Domain user access rights and file ownership/access controls can be set
75 from the single Domain Security Account Manager (SAM) database
76 (works with domain member servers as well as with MS Windows workstations
77 that are domain members).
81 <indexterm><primary>domain members</primary></indexterm>
82 <indexterm><primary>network logon</primary></indexterm>
83 Only <application>MS Windows NT4/200x/XP Professional</application>
84 workstations that are domain members can use network logon facilities.
88 <indexterm><primary>domain member</primary></indexterm>
89 <indexterm><primary>policy files</primary></indexterm>
90 <indexterm><primary>NTConfig.POL</primary></indexterm>
91 <indexterm><primary>desktop profiles</primary></indexterm>
92 Domain member workstations can be better controlled through the use of
93 policy files (<filename>NTConfig.POL</filename>) and desktop profiles.
97 <indexterm><primary>logon script</primary></indexterm>
98 <indexterm><primary>transparent access</primary></indexterm>
99 <indexterm><primary>application servers</primary></indexterm>
100 Through the use of logon scripts, users can be given transparent access to network
101 applications that run off application servers.
105 <indexterm><primary>user access management</primary></indexterm>
106 <indexterm><primary>SAM</primary></indexterm>
107 <indexterm><primary>LDAP</primary></indexterm>
108 <indexterm><primary>ADS</primary></indexterm>
109 Network administrators gain better application and user access management
110 abilities because there is no need to maintain user accounts on any network
111 client or server other than the central domain database
112 (either NT4/Samba SAM-style domain, NT4 domain that is backend-ed with an
113 LDAP directory, or via an Active Directory infrastructure).
119 <sect1 id="machine-trust-accounts">
120 <title>MS Windows Workstation/Server Machine Trust Accounts</title>
123 <indexterm><primary>Machine Trust Accounts</primary></indexterm>
124 <indexterm><primary>authenticate</primary></indexterm>
125 <indexterm><primary>domain controller</primary></indexterm>
126 <indexterm><primary>rogue user</primary></indexterm>
127 A Machine Trust Account is an account that is used to authenticate a client machine (rather than a user) to
128 the domain controller server. In Windows terminology, this is known as a <quote>computer account.</quote> The
129 purpose of the machine trust account is to prevent a rogue user and domain controller from colluding to gain
130 access to a domain member workstation.
134 <indexterm><primary>machine trust account</primary><secondary>password</secondary></indexterm>
135 <indexterm><primary>shared secret</primary></indexterm>
136 <indexterm><primary>unauthorized</primary></indexterm>
137 <indexterm><primary>Windows NT/200x/XP Professional</primary></indexterm>
138 <indexterm><primary>Windows 9x/Me/XP Home</primary></indexterm>
139 The password of a Machine Trust Account acts as the shared secret for secure communication with the domain
140 controller. This is a security feature to prevent an unauthorized machine with the same NetBIOS name from
141 joining the domain, participating in domain security operations, and gaining access to domain user/group
142 accounts. Windows NT/200x/XP Professional clients use machine trust accounts, but Windows 9x/Me/XP Home
143 clients do not. Hence, a Windows 9x/Me/XP Home client is never a true member of a domain because it does not
144 possess a Machine Trust Account, and, thus, has no shared secret with the domain controller.
148 <indexterm><primary>Windows Registry</primary></indexterm>
149 <indexterm><primary>PDC</primary></indexterm>
150 <indexterm><primary>ADS</primary></indexterm>
151 <indexterm><primary>Machine Trust Account</primary></indexterm>
152 A Windows NT4 PDC stores each Machine Trust Account in the Windows Registry.
153 The introduction of MS Windows 2000 saw the introduction of Active Directory,
154 the new repository for Machine Trust Accounts. A Samba PDC, however, stores
155 each Machine Trust Account in two parts,
160 <indexterm><primary>domain security account</primary></indexterm>
161 <indexterm><primary>account information</primary></indexterm>
162 <indexterm><primary>backend database</primary></indexterm>
163 A domain security account (stored in the <smbconfoption name="passdb backend"/>) that has been configured in
164 the &smb.conf; file. The precise nature of the account information that is stored depends on the type of
165 backend database that has been chosen.
169 <indexterm><primary>smbpasswd</primary></indexterm>
170 <indexterm><primary>UNIX login ID</primary></indexterm>
171 <indexterm><primary>UID</primary></indexterm>
172 <indexterm><primary>LanMan</primary></indexterm>
173 <indexterm><primary>NT-encrypted password</primary></indexterm>
174 <indexterm><primary>UNIX user identifier</primary><see>UID</see></indexterm>
175 The older format of this data is the <filename>smbpasswd</filename> database
176 that contains the UNIX login ID, the UNIX user identifier (UID), and the
177 LanMan and NT-encrypted passwords. There is also some other information in
178 this file that we do not need to concern ourselves with here.
182 <indexterm><primary>database</primary></indexterm>
183 <indexterm><primary>ldapsam</primary></indexterm>
184 <indexterm><primary>smbpasswd</primary></indexterm>
185 <indexterm><primary>account controls</primary></indexterm>
186 The two newer database types are called ldapsam and tdbsam. Both store considerably more data than the older
187 <filename>smbpasswd</filename> file did. The extra information enables new user account controls to be
192 <indexterm><primary>UNIX account</primary></indexterm>
193 <indexterm><primary>/etc/passwd</primary></indexterm>
194 A corresponding UNIX account, typically stored in <filename>/etc/passwd</filename>. Work is in progress to
195 allow a simplified mode of operation that does not require UNIX user accounts, but this has not been a feature
196 of the early releases of Samba-3, and is not currently planned for release either.
203 <indexterm><primary>Machine Trust Accounts</primary><secondary>creating</secondary></indexterm>
204 There are three ways to create Machine Trust Accounts:
209 <indexterm><primary>manual UNIX account creation</primary></indexterm>
210 Manual creation from the UNIX/Linux command line. Here, both the Samba and
211 corresponding UNIX account are created by hand.
215 <indexterm><primary>Server Manager</primary></indexterm>
216 <indexterm><primary>Nexus toolkit</primary></indexterm>
217 Using the MS Windows NT4 Server Manager, either from an NT4 domain member
218 server or using the Nexus toolkit available from the Microsoft Web site.
219 This tool can be run from any MS Windows machine as long as the user is
220 logged on as the administrator account.
224 <indexterm><primary>Machine Trust Account</primary></indexterm>
225 <indexterm><primary>joined client</primary></indexterm>
226 <quote>On-the-fly</quote> creation. The Samba Machine Trust Account is automatically
227 created by Samba at the time the client is joined to the domain.
228 (For security, this is the recommended method.) The corresponding UNIX
229 account may be created automatically or manually.
234 <indexterm><primary>enforcing</primary></indexterm>
235 <indexterm><primary>machine trust account</primary><secondary>creation</secondary></indexterm>
236 Neither MS Windows NT4/200x/XP Professional, nor Samba, provide any method for enforcing the method of machine
237 trust account creation. This is a matter of the administrator's choice.
241 <title>Manual Creation of Machine Trust Accounts</title>
244 <indexterm><primary>/etc/passwd</primary></indexterm>
245 <indexterm><primary>useradd</primary></indexterm>
246 <indexterm><primary>vipw</primary></indexterm>
247 The first step in manually creating a Machine Trust Account is to manually
248 create the corresponding UNIX account in <filename>/etc/passwd</filename>.
249 This can be done using <command>vipw</command> or another <quote>adduser</quote> command
250 that is normally used to create new UNIX accounts. The following is an example for
251 a Linux-based Samba server:
253 &rootprompt;<userinput>/usr/sbin/useradd -g machines -d /var/lib/nobody \
254 -c <replaceable>"machine nickname"</replaceable> \
255 -s /bin/false <replaceable>machine_name</replaceable>$ </userinput>
257 &rootprompt;<userinput>passwd -l <replaceable>machine_name</replaceable>$</userinput>
262 <indexterm><primary>primary group</primary></indexterm>
263 <indexterm><primary>GID</primary></indexterm>
264 <indexterm><primary>machine accounts</primary></indexterm>
265 In the example above there is an existing system group <quote>machines</quote> which is used
266 as the primary group for all machine accounts. In the following examples the <quote>machines</quote> group
271 <indexterm><primary>chpass</primary></indexterm>
272 <indexterm><primary>BSD</primary></indexterm>
273 On *BSD systems, this can be done using the <command>chpass</command> utility:
275 &rootprompt;<userinput>chpass -a \
276 '<replaceable>machine_name</replaceable>$:*:101:100::0:0:Windows <replaceable>machine_name</replaceable>:/dev/null:/sbin/nologin'</userinput>
281 <indexterm><primary>/etc/passwd</primary></indexterm>
282 <indexterm><primary>$</primary></indexterm>
283 <indexterm><primary>null shell</primary></indexterm>
284 <indexterm><primary>home directory</primary></indexterm>
285 The <filename>/etc/passwd</filename> entry will list the machine name
286 with a <quote>$</quote> appended, and will not have a password, will have a null shell and no
287 home directory. For example, a machine named <quote>doppy</quote> would have an
288 <filename>/etc/passwd</filename> entry like this:
290 doppy$:x:505:100:<replaceable>machine_nickname</replaceable>:/dev/null:/bin/false
295 <indexterm><primary>machine_nickname</primary></indexterm>
296 <indexterm><primary>machine_name</primary></indexterm>
297 <indexterm><primary>Machine Trust Account</primary></indexterm>
298 in which <replaceable>machine_nickname</replaceable> can be any
299 descriptive name for the client, such as BasementComputer.
300 <replaceable>machine_name</replaceable> absolutely must be the NetBIOS
301 name of the client to be joined to the domain. The <quote>$</quote> must be
302 appended to the NetBIOS name of the client or Samba will not recognize
303 this as a Machine Trust Account.
307 <indexterm><primary>UNIX account</primary></indexterm>
308 <indexterm><primary>Samba account</primary></indexterm>
309 <indexterm><primary>Machine Trust Account</primary><secondary>password</secondary></indexterm>
310 Now that the corresponding UNIX account has been created, the next step is to create
311 the Samba account for the client containing the well-known initial
312 Machine Trust Account password. This can be done using the
313 <command>smbpasswd</command> command
316 &rootprompt;<userinput>smbpasswd -a -m <replaceable>machine_name</replaceable></userinput>
321 <indexterm><primary>machine_name</primary></indexterm>
322 <indexterm><primary>NetBIOS name</primary></indexterm>
323 <indexterm><primary>RID</primary></indexterm>
324 <indexterm><primary>UID</primary></indexterm>
325 where <replaceable>machine_name</replaceable> is the machine's NetBIOS
326 name. The RID of the new machine account is generated from the UID of
327 the corresponding UNIX account.
331 <title>Join the client to the domain immediately</title>
334 <indexterm><primary>Machine Trust Account</primary></indexterm>
335 <indexterm><primary>PDC</primary></indexterm>
336 <indexterm><primary>Server Manager</primary></indexterm>
337 <indexterm><primary>changes password</primary></indexterm>
338 <indexterm><primary>NetBIOS name</primary></indexterm>
339 Manually creating a Machine Trust Account using this method is the
340 equivalent of creating a Machine Trust Account on a Windows NT PDC using
341 <indexterm><primary>Server Manager</primary></indexterm>
342 the <application>Server Manager</application>. From the time at which the
343 account is created to the time the client joins the domain and
344 changes the password, your domain is vulnerable to an intruder joining
345 your domain using a machine with the same NetBIOS name. A PDC inherently
346 trusts members of the domain and will serve out a large degree of user
347 information to such clients. You have been warned!
353 <title>Managing Domain Machine Accounts using NT4 Server Manager</title>
356 <indexterm><primary>machine trust accounts</primary></indexterm>
357 <indexterm><primary>automatic account creation</primary></indexterm>
358 <indexterm><primary>Server Manager</primary></indexterm>
359 A working <smbconfoption name="add machine script"/> is essential
360 for machine trust accounts to be automatically created. This applies no matter whether
361 you use automatic account creation or the NT4 Domain Server Manager.
365 <indexterm><primary>SRVTOOLS.EXE</primary></indexterm>
366 <indexterm><primary>SrvMgr.exe</primary></indexterm>
367 <indexterm><primary>UsrMgr.exe</primary></indexterm>
368 <indexterm><primary>domain management tools</primary></indexterm>
369 If the machine from which you are trying to manage the domain is an
370 <application>MS Windows NT4 workstation or MS Windows 200x/XP Professional</application>,
371 the tool of choice is the package called <command>SRVTOOLS.EXE</command>.
372 When executed in the target directory it will unpack <command>SrvMgr.exe</command>
373 and <command>UsrMgr.exe</command> (both are domain management tools for MS Windows NT4 workstation).
377 <indexterm><primary>Nexus.exe</primary></indexterm>
378 <indexterm><primary>Microsoft Windows 9x/Me</primary></indexterm>
379 If your workstation is a <application>Microsoft Windows 9x/Me</application> family product,
380 you should download the <command>Nexus.exe</command> package from the Microsoft Web site.
381 When executed from the target directory, it will unpack the same tools but for use on
386 Further information about these tools may be obtained from Knowledge Base articles
387 <ulink url="http://support.microsoft.com/default.aspx?scid=kb;en-us;173673">173673</ulink>, and
388 <ulink url="http://support.microsoft.com/default.aspx?scid=kb;en-us;172540">172540</ulink>
392 <indexterm><primary>srvmgr.exe</primary></indexterm>
393 <indexterm><primary>Server Manager for Domains</primary></indexterm>
394 Launch the <command>srvmgr.exe</command> (Server Manager for Domains) and follow these steps:
398 <title>Server Manager Account Machine Account Management</title>
400 From the menu select <guimenu>Computer</guimenu>.
404 Click <guimenuitem>Select Domain</guimenuitem>.
408 Click the name of the domain you wish to administer in the
409 <guilabel>Select Domain</guilabel> panel and then click
410 <guibutton>OK</guibutton>.
414 Again from the menu select <guimenu>Computer</guimenu>.
418 Select <guimenuitem>Add to Domain</guimenuitem>.
422 In the dialog box, click the radio button to
423 <guilabel>Add NT Workstation of Server</guilabel>, then
424 enter the machine name in the field provided, and click the
425 <guibutton>Add</guibutton> button.
432 <title>On-the-Fly Creation of Machine Trust Accounts</title>
435 <indexterm><primary>Machine Trust Account</primary><secondary>creation</secondary></indexterm>
436 The third (and recommended) way of creating Machine Trust Accounts is simply to allow the Samba server to
437 create them as needed when the client is joined to the domain.
441 <indexterm><primary>Machine Trust Account</primary><secondary>UNIX account</secondary></indexterm>
442 <indexterm><primary>UNIX account</primary></indexterm>
443 <indexterm><primary>add machine script</primary></indexterm>
444 Since each Samba Machine Trust Account requires a corresponding UNIX account, a method
445 for automatically creating the UNIX account is usually supplied; this requires configuration of the
446 add machine script option in &smb.conf;. This method is not required; however, corresponding UNIX
447 accounts may also be created manually.
452 <indexterm><primary>useradd</primary></indexterm>
453 <indexterm><primary>Red Hat Linux</primary></indexterm>
454 Here is an example for a Red Hat Linux system:
456 <smbconfsection name="[global]"/>
457 <smbconfoption name="add machine script">/usr/sbin/useradd -d /var/lib/nobody -g 100 -s /bin/false -M %u</smbconfoption>
463 <sect2><title>Making an MS Windows Workstation or Server a Domain Member</title>
466 The procedure for making an MS Windows workstation or server a member of the domain varies
467 with the version of Windows.
471 <title>Windows 200x/XP Professional Client</title>
474 <indexterm><primary>domain member</primary></indexterm>
475 <indexterm><primary>machine trust account</primary><secondary>create privilege</secondary></indexterm>
476 <indexterm><primary>privileges</primary></indexterm>
477 <indexterm><primary>root</primary></indexterm>
478 When the user elects to make the client a domain member, Windows 200x prompts for
479 an account and password that has privileges to create machine accounts in the domain.
480 A Samba administrator account (i.e., a Samba account that has <constant>root</constant> privileges on the
481 Samba server) must be entered here; the operation will fail if an ordinary user
486 <indexterm><primary>administrator account</primary></indexterm>
487 <indexterm><primary>/etc/passwd</primary></indexterm>
488 For security reasons, the password for this administrator account should be set
489 to a password that is other than that used for the root user in <filename>/etc/passwd</filename>.
493 <indexterm><primary>account</primary></indexterm>
494 <indexterm><primary>create domain member</primary></indexterm>
495 <indexterm><primary>root</primary></indexterm>
496 <indexterm><primary>map</primary></indexterm>
497 The name of the account that is used to create domain member machine trust accounts can be
498 anything the network administrator may choose. If it is other than <constant>root</constant>,
499 then this is easily mapped to <constant>root</constant> in the file named in the &smb.conf; parameter
500 <smbconfoption name="username map">/etc/samba/smbusers</smbconfoption>.
504 <indexterm><primary>administrator account</primary></indexterm>
505 <indexterm><primary>encryption key</primary></indexterm>
506 <indexterm><primary>machine trust account</primary></indexterm>
507 The session key of the Samba administrator account acts as an encryption key for setting the password of the machine trust
508 account. The Machine Trust Account will be created on-the-fly, or updated if it already exists.
513 <title>Windows NT4 Client</title>
516 <indexterm><primary>Machine Trust Account</primary></indexterm>
517 <indexterm><primary>Create a Computer Account</primary></indexterm>
518 <indexterm><primary>join the machine</primary></indexterm>
519 If the Machine Trust Account was created manually, on the
520 Identification Changes menu enter the domain name, but do not
521 check the box <guilabel>Create a Computer Account in the Domain</guilabel>.
522 In this case, the existing Machine Trust Account is used to join the machine
527 <indexterm><primary>Machine Trust Account</primary></indexterm>
528 <indexterm><primary>on the fly</primary></indexterm>
529 <indexterm><primary>Computer Account</primary></indexterm>
530 <indexterm><primary>administrator account</primary></indexterm>
531 If the Machine Trust Account is to be created on the fly, on the Identification Changes menu enter the domain
532 name and check the box <guilabel>Create a Computer Account in the Domain</guilabel>. In this case, joining
533 the domain proceeds as above for Windows 2000 (i.e., you must supply a Samba administrator account when
539 <title>Samba Client</title>
542 Joining a Samba client to a domain is documented in <link linkend="domain-member-server">the next section</link>.
549 <sect1 id="domain-member-server">
550 <title>Domain Member Server</title>
553 <indexterm><primary>domain security</primary></indexterm>
554 <indexterm><primary>security context</primary></indexterm>
555 <indexterm><primary>authentication regime</primary></indexterm>
556 <indexterm><primary>ADS</primary></indexterm>
557 This mode of server operation involves the Samba machine being made a member
558 of a domain security context. This means by definition that all user
559 authentication will be done from a centrally defined authentication regime.
560 The authentication regime may come from an NT3/4-style (old domain technology)
561 server, or it may be provided from an Active Directory server (ADS) running on
562 MS Windows 2000 or later.
567 <indexterm><primary>authentication</primary><secondary>backend</secondary></indexterm>
568 <indexterm><primary>distributed directory</primary></indexterm>
569 <indexterm><primary>LDAP</primary></indexterm>
570 <indexterm><primary>OpenLDAP</primary></indexterm>
571 <indexterm><primary>iPlanet</primary></indexterm>
572 <indexterm><primary>Sun</primary></indexterm>
573 <indexterm><primary>Novell</primary></indexterm>
574 <indexterm><primary>e-Directory</primary></indexterm>
575 Of course it should be clear that the authentication backend itself could be
576 from any distributed directory architecture server that is supported by Samba.
577 This can be LDAP (from OpenLDAP), or Sun's iPlanet, or Novell e-Directory
583 <indexterm><primary>LDAP</primary></indexterm>
584 <indexterm><primary>identity management</primary></indexterm>
585 <indexterm><primary>machine authentication</primary></indexterm>
586 When Samba is configured to use an LDAP or other identity management and/or
587 directory service, it is Samba that continues to perform user and machine
588 authentication. It should be noted that the LDAP server does not perform
589 authentication handling in place of what Samba is designed to do.
593 <indexterm><primary>create a domain machine account</primary></indexterm>
594 <indexterm><primary>domain member server</primary></indexterm>
595 <indexterm><primary>join the domain</primary></indexterm>
596 Please refer to <link linkend="samba-pdc">Domain Control</link>, for more information regarding
597 how to create a domain machine account for a domain member server as well as for
598 information on how to enable the Samba domain member machine to join the domain
599 and be fully trusted by it.
603 <title>Joining an NT4-type Domain with Samba-3</title>
605 <para><link linkend="assumptions">Assumptions</link> lists names that are used in the remainder of this chapter.</para>
607 <table frame="all" id="assumptions"><title>Assumptions</title>
609 <colspec align="right"/>
610 <colspec align="left"/>
613 <entry>Samba DMS NetBIOS name:</entry><entry>SERV1</entry>
616 <entry>Windows 200x/NT domain name:</entry><entry>&example.workgroup;</entry>
619 <entry>Domain's PDC NetBIOS name:</entry><entry>DOMPDC</entry>
622 <entry>Domain's BDC NetBIOS names:</entry><entry>DOMBDC1 and DOMBDC2</entry>
629 First, you must edit your &smb.conf; file to tell Samba it should now use domain security.
633 <indexterm><primary>security = user</primary></indexterm>
634 <indexterm><primary>standalone server</primary></indexterm>
635 <indexterm><primary>domain member server</primary></indexterm>
636 <indexterm><primary>domain security</primary></indexterm>
637 Change (or add) your <smbconfoption name="security"/> line in the [global] section
638 of your &smb.conf; to read:
640 <smbconfoption name="security">domain</smbconfoption>
642 Note that if the parameter <parameter>security = user</parameter> is used, this machine would function as a
643 standalone server and not as a domain member server. Domain security mode causes Samba to work within the
644 domain security context.
648 Next change the <smbconfoption name="workgroup"/> line in the <smbconfsection name="[global]"/>
651 <smbconfoption name="workgroup">&example.workgroup;</smbconfoption>
653 This is the name of the domain we are joining.
657 <indexterm><primary>authenticate</primary></indexterm>
658 <indexterm><primary>PDC</primary></indexterm>
659 You must also have the parameter <smbconfoption name="encrypt passwords"/>
660 set to <constant>yes</constant> in order for your users to authenticate to the NT PDC.
661 This is the default setting if this parameter is not specified. There is no need to specify this
662 parameter, but if it is specified in the &smb.conf; file, it must be set to <constant>Yes</constant>.
666 <indexterm><primary>PDC</primary></indexterm>
667 <indexterm><primary>BDC</primary></indexterm>
668 <indexterm><primary>authenticate users</primary></indexterm>
669 <indexterm><primary>domain controllers</primary></indexterm>
670 Finally, add (or modify) a <smbconfoption name="password server"/> line in the [global]
673 <smbconfoption name="password server">DOMPDC DOMBDC1 DOMBDC2</smbconfoption>
675 These are the PDC and BDCs Samba
676 will attempt to contact in order to authenticate users. Samba will
677 try to contact each of these servers in order, so you may want to
678 rearrange this list in order to spread out the authentication load
679 among Domain Controllers.
683 <indexterm><primary>list of domain controllers</primary></indexterm>
684 <indexterm><primary>mechanism</primary></indexterm>
685 <indexterm><primary>broadcast-based name resolution</primary></indexterm>
686 <indexterm><primary>DNS name resolution</primary></indexterm>
687 Alternatively, if you want smbd to determine automatically the list of domain controllers to use for
688 authentication, you may set this line to be:
690 <smbconfoption name="password server">*</smbconfoption>
692 <indexterm><primary>WINS</primary></indexterm>
693 This method allows Samba to use exactly the same mechanism that NT does. The
694 method either uses broadcast-based name resolution, performs a WINS database
695 lookup in order to find a domain controller against which to authenticate,
696 or locates the domain controller using DNS name resolution.
700 To join the domain, run this command:
701 <indexterm><primary>net</primary><secondary>rpc</secondary><tertiary>join</tertiary></indexterm>
703 &rootprompt;<userinput>net rpc join -S DOMPDC -U<replaceable>Administrator%password</replaceable></userinput>
708 <indexterm><primary>NetBIOS name</primary></indexterm>
709 <indexterm><primary>PDC</primary></indexterm>
710 <indexterm><primary>WINS lookup</primary></indexterm>
711 <indexterm><primary>NetBIOS broadcast</primary></indexterm>
712 If the <option>-S DOMPDC</option> argument is not given, the domain name will be obtained from &smb.conf; and
713 the NetBIOS name of the PDC will be obtained either using a WINS lookup or via NetBIOS broadcast based name
718 <indexterm><primary>joining the domain</primary></indexterm>
719 <indexterm><primary>PDC</primary></indexterm>
720 <indexterm><primary>Administrator%password</primary></indexterm>
721 <indexterm><primary>Joined domain</primary></indexterm>
722 The machine is joining the domain DOM, and the PDC for that domain (the only machine
723 that has write access to the domain SAM database) is DOMPDC; therefore, use the <option>-S</option>
724 option. The <replaceable>Administrator%password</replaceable> is the login name and
725 password for an account that has the necessary privilege to add machines to the
726 domain. If this is successful, you will see the following message in your terminal window.
727 Where the older NT4-style domain architecture is used:
729 <computeroutput>Joined domain DOM.</computeroutput>
734 <indexterm><primary>net</primary><secondary>ads</secondary><tertiary>join</tertiary></indexterm>
735 <indexterm><primary>ADS</primary></indexterm>
736 <indexterm><primary>join the ADS domain</primary></indexterm>
737 Where Active Directory is used, the command used to join the ADS domain is:
739 &rootprompt; net ads join -U<replaceable>Administrator%password</replaceable>
741 And the following output is indicative of a successful outcome:
743 <computeroutput>Joined SERV1 to realm MYREALM.</computeroutput>
748 Refer to the <command>net</command> man page and to <link linkend="NetCommand">the chapter on remote
749 administration</link> for further information.
753 <indexterm><primary>join the domain</primary></indexterm>
754 <indexterm><primary>create machine trust account</primary></indexterm>
755 <indexterm><primary>PDC</primary></indexterm>
756 This process joins the server to the domain without separately having to create the machine
757 trust account on the PDC beforehand.
761 <indexterm><primary>machine account password</primary><secondary>change protocol</secondary></indexterm>
762 <indexterm><primary>random machine account password</primary></indexterm>
763 <indexterm><primary>/usr/local/samba/private/secrets.tdb</primary></indexterm>
764 <indexterm><primary>/etc/samba/secrets.tdb</primary></indexterm>
765 This command goes through the machine account password change protocol, then writes the new (random) machine
766 account password for this Samba server into a file in the same directory in which a smbpasswd file would be
767 normally stored. The trust account information that is needed by the DMS is written into the file
768 <filename>/usr/local/samba/private/secrets.tdb</filename> or <filename>/etc/samba/secrets.tdb</filename>.
772 <indexterm><primary>domain-level security</primary></indexterm>
773 <indexterm><primary>shadow password file</primary></indexterm>
774 This file is created and owned by root and is not readable by any other user. It is
775 the key to the domain-level security for your system and should be treated as carefully
776 as a shadow password file.
780 <indexterm><primary>Samba daemons</primary></indexterm>
781 <indexterm><primary>distribution</primary></indexterm>
782 <indexterm><primary>/etc/init.d/samba</primary></indexterm>
783 Finally, restart your Samba daemons and get ready for clients to begin using domain
784 security. The way you can restart your Samba daemons depends on your distribution,
785 but in most cases the following will suffice:
787 &rootprompt;/etc/init.d/samba restart
794 <title>Why Is This Better Than <parameter>security = server</parameter>?</title>
797 <indexterm><primary>domain security</primary></indexterm>
798 <indexterm><primary>UNIX users</primary></indexterm>
799 <indexterm><primary>authentication</primary></indexterm>
800 Currently, domain security in Samba does not free you from having to create local UNIX users to represent the
801 users attaching to your server. This means that if domain user <constant>DOM\fred</constant> attaches to your
802 domain security Samba server, there needs to be a local UNIX user fred to represent that user in the UNIX file
803 system. This is similar to the older Samba security mode <smbconfoption
804 name="security">server</smbconfoption>, where Samba would pass through the authentication request to a Windows
805 NT server in the same way as a Windows 95 or Windows 98 server would.
809 <indexterm><primary>winbind</primary></indexterm>
810 <indexterm><primary>UID</primary></indexterm>
811 <indexterm><primary>GID</primary></indexterm>
812 Please refer to <link linkend="winbind">Winbind: Use of Domain Accounts</link>, for information on a system
813 to automatically assign UNIX UIDs and GIDs to Windows NT domain users and groups.
817 <indexterm><primary>domain-level</primary></indexterm>
818 <indexterm><primary>authentication</primary></indexterm>
819 <indexterm><primary>RPC</primary></indexterm>
820 The advantage of domain-level security is that the authentication in domain-level security is passed down the
821 authenticated RPC channel in exactly the same way that an NT server would do it. This means Samba servers now
822 participate in domain trust relationships in exactly the same way NT servers do (i.e., you can add Samba
823 servers into a resource domain and have the authentication passed on from a resource domain PDC to an account
828 <indexterm><primary>PDC</primary></indexterm>
829 <indexterm><primary>BDC</primary></indexterm>
830 <indexterm><primary>connection resources</primary></indexterm>
831 In addition, with <smbconfoption name="security">server</smbconfoption>, every Samba daemon on a server has to
832 keep a connection open to the authenticating server for as long as that daemon lasts. This can drain the
833 connection resources on a Microsoft NT server and cause it to run out of available connections. With
834 <smbconfoption name="security">domain</smbconfoption>, however, the Samba daemons connect to the PDC or BDC
835 only for as long as is necessary to authenticate the user and then drop the connection, thus conserving PDC
836 connection resources.
840 <indexterm><primary>PDC</primary></indexterm>
841 <indexterm><primary>authentication reply</primary></indexterm>
842 <indexterm><primary>SID</primary></indexterm>
843 <indexterm><primary>NT groups</primary></indexterm>
844 Finally, acting in the same manner as an NT server authenticating to a PDC means that as part of the
845 authentication reply, the Samba server gets the user identification information such as the user SID, the list
846 of NT groups the user belongs to, and so on.
851 Much of the text of this document was first published in the Web magazine
852 <ulink url="http://www.linuxworld.com"><emphasis>LinuxWorld</emphasis></ulink> as the article <ulink
853 url="http://www.linuxworld.com/linuxworld/lw-1998-10/lw-10-samba.html"/>
854 <emphasis>Doing the NIS/NT Samba</emphasis>.
861 <sect1 id="ads-member">
862 <title>Samba ADS Domain Membership</title>
865 <indexterm significance="preferred"><primary>Active Directory</primary></indexterm>
866 <indexterm significance="preferred"><primary>ADS</primary><see>Active Directory</see></indexterm>
867 <indexterm><primary>KDC</primary></indexterm>
868 <indexterm><primary>Kerberos</primary></indexterm>
869 This is a rough guide to setting up Samba-3 with Kerberos authentication against a
870 Windows 200x KDC. A familiarity with Kerberos is assumed.
874 <title>Configure &smb.conf;</title>
877 You must use at least the following three options in &smb.conf;:
881 <smbconfoption name="realm">your.kerberos.REALM</smbconfoption>
882 <smbconfoption name="security">ADS</smbconfoption>
883 <smbconfcomment>The following parameter need only be specified if present.</smbconfcomment>
884 <smbconfcomment>The default setting if not present is Yes.</smbconfcomment>
885 <smbconfoption name="encrypt passwords">yes</smbconfoption>
889 <indexterm><primary>ADS</primary></indexterm>
890 <indexterm><primary>realm</primary></indexterm>
891 <indexterm><primary>DNS</primary></indexterm>
892 <indexterm><primary>ADS DC</primary></indexterm>
893 <indexterm><primary>password server</primary></indexterm>
894 In case samba cannot correctly identify the appropriate ADS server using the realm name, use the
895 <smbconfoption name="password server"/> option in &smb.conf;:
897 <smbconfoption name="password server">your.kerberos.server</smbconfoption>
899 The most common reason for which Samba may not be able to locate the ADS domain controller is a consequence of
900 sites maintaining some DNS servers on UNIX systems without regard for the DNS requirements of the ADS
901 infrastructure. There is no harm in specifying a preferred ADS domain controller using the <parameter>password
906 <indexterm><primary>smbpasswd</primary></indexterm>
907 <indexterm><primary>authenticated</primary></indexterm>
908 You do <emphasis>not</emphasis> need an smbpasswd file, and older clients will be authenticated as
909 if <smbconfoption name="security">domain</smbconfoption>, although it will not do any harm and
910 allows you to have local users not in the domain.
916 <title>Configure <filename>/etc/krb5.conf</filename></title>
919 <indexterm><primary>/etc/krb5.conf</primary></indexterm>
920 <indexterm><primary>Kerberos</primary><secondary>/etc/krb5.conf</secondary></indexterm>
921 <indexterm><primary>MIT</primary></indexterm>
922 <indexterm><primary>Heimdal</primary></indexterm>
923 With both MIT and Heimdal Kerberos, it is unnecessary to configure the <filename>/etc/krb5.conf</filename>,
924 and it may be detrimental.
928 <indexterm><primary>ADS</primary></indexterm>
929 <indexterm><primary>SRV records</primary></indexterm>
930 <indexterm><primary>DNS zone</primary></indexterm>
931 <indexterm><primary>KDC</primary></indexterm>
932 <indexterm><primary>_kerberos.REALM.NAME</primary></indexterm>
933 Microsoft ADS automatically create SRV records in the DNS zone
934 <parameter>_kerberos._tcp.REALM.NAME</parameter> for each KDC in the realm. This is part
935 of the installation and configuration process used to create an Active Directory domain.
936 A KDC is a Kerberos Key Distribution Center and forms an integral part of the Microsoft
937 active directory infrastructure.
941 <indexterm><primary>kinit</primary></indexterm>
942 <indexterm><primary>DES-CBC-MD5</primary></indexterm>
943 <indexterm><primary>DES-CBC-CRC</primary></indexterm>
944 <indexterm><primary>encryption types</primary></indexterm>
945 <indexterm><primary>kerberos</primary></indexterm>
946 <indexterm><primary>Windows 2000</primary></indexterm>
947 UNIX systems can use kinit and the DES-CBC-MD5 or DES-CBC-CRC encryption types to authenticate to the Windows
948 2000 KDC. For further information regarding Windows 2000 ADS kerberos interoperability please refer to the
949 Microsoft Windows 2000 Kerberos <ulink
950 url="http://www.microsoft.com/windows2000/techinfo/planning/security/kerbsteps.asp">Interoperability</ulink>
951 guide. Another very useful document that may be referred to for general information regarding Kerberos
952 interoperability is <ulink url="http://www.ietf.org/rfc/rfc1510.txt?number=1510">RFC1510</ulink>. This RFC
953 explains much of the magic behind the operation of Kerberos.
957 <indexterm><primary>MIT</primary></indexterm>
958 <indexterm><primary>KRB5</primary></indexterm>
959 <indexterm><primary>SRV records</primary></indexterm>
960 <indexterm><primary>krb5.conf</primary></indexterm>
961 <indexterm><primary>DNS lookup</primary></indexterm>
962 <indexterm><primary>libraries</primary></indexterm>
963 MIT's, as well as Heimdal's, recent KRB5 libraries default to checking for SRV records, so they will
964 automatically find the KDCs. In addition, <filename>krb5.conf</filename> only allows specifying
965 a single KDC, even there if there may be more than one. Using the DNS lookup allows the KRB5
966 libraries to use whichever KDCs are available.
970 <indexterm><primary>krb5.conf</primary></indexterm>
971 When manually configuring <filename>krb5.conf</filename>, the minimal configuration is:
974 default_realm = YOUR.KERBEROS.REALM
977 YOUR.KERBEROS.REALM = {
978 kdc = your.kerberos.server
982 .kerberos.server = YOUR.KERBEROS.REALM
987 <indexterm><primary>Heimdal</primary></indexterm>
988 When using Heimdal versions before 0.6, use the following configuration settings:
991 default_realm = YOUR.KERBEROS.REALM
992 default_etypes = des-cbc-crc des-cbc-md5
993 default_etypes_des = des-cbc-crc des-cbc-md5
996 YOUR.KERBEROS.REALM = {
997 kdc = your.kerberos.server
1001 .kerberos.server = YOUR.KERBEROS.REALM
1006 <indexterm><primary>KDC</primary></indexterm>
1007 <indexterm><primary>kinit</primary></indexterm>
1008 Test your config by doing a <userinput>kinit
1009 <replaceable>USERNAME</replaceable>@<replaceable>REALM</replaceable></userinput> and
1010 making sure that your password is accepted by the Win2000 KDC.
1014 <indexterm><primary>Heimdal</primary></indexterm>
1015 <indexterm><primary>ADS</primary></indexterm>
1016 <indexterm><primary>KDC</primary></indexterm>
1017 <indexterm><primary>Windows 2003</primary></indexterm>
1018 With Heimdal versions earlier than 0.6.x you can use only newly created accounts
1019 in ADS or accounts that have had the password changed once after migration, or
1020 in case of <constant>Administrator</constant> after installation. At the
1021 moment, a Windows 2003 KDC can only be used with Heimdal releases later than 0.6
1022 (and no default etypes in krb5.conf). Unfortunately, this whole area is still
1027 <indexterm><primary>realm</primary></indexterm>
1028 <indexterm><primary>uppercase</primary></indexterm>
1029 <indexterm><primary>KDC</primary></indexterm>
1030 The realm must be in uppercase or you will get a <quote><errorname>Cannot find KDC for
1031 requested realm while getting initial credentials</errorname></quote> error (Kerberos
1032 is case-sensitive!).
1036 <indexterm><primary>synchronize</primary></indexterm>
1037 <indexterm><primary>credentials</primary></indexterm>
1038 <indexterm><primary>time difference</primary></indexterm>
1039 <indexterm><primary>clock skew</primary></indexterm>
1040 Time between the two servers must be synchronized. You will get a <quote><errorname>kinit(v5): Clock skew too
1041 great while getting initial credentials</errorname></quote> if the time difference (clock skew) is more than five minutes.
1045 <indexterm><primary>clock skew</primary></indexterm>
1046 <indexterm><primary>Kerberos</primary></indexterm>
1047 Clock skew limits are configurable in the Kerberos protocols. The default setting is five minutes.
1051 <indexterm><primary>DNS</primary></indexterm>
1052 <indexterm><primary>KDC</primary></indexterm>
1053 <indexterm><primary>hostname</primary></indexterm>
1054 <indexterm><primary>realm</primary></indexterm>
1055 You also must ensure that you can do a reverse DNS lookup on the IP address of your KDC. Also, the name that
1056 this reverse lookup maps to must either be the NetBIOS name of the KDC (i.e., the hostname with no domain
1057 attached) or it can be the NetBIOS name followed by the realm.
1061 <indexterm><primary>/etc/hosts</primary></indexterm>
1062 <indexterm><primary>KDC</primary></indexterm>
1063 <indexterm><primary>realm</primary></indexterm>
1064 The easiest way to ensure you get this right is to add a <filename>/etc/hosts</filename> entry mapping the IP
1065 address of your KDC to its NetBIOS name. If you do not get this correct, then you will get a <errorname>local
1066 error</errorname> when you try to join the realm.
1070 <indexterm><primary>Kerberos</primary></indexterm>
1071 <indexterm><primary>Create the Computer Account</primary></indexterm>
1072 <indexterm><primary>Testing Server Setup</primary></indexterm>
1073 If all you want is Kerberos support in &smbclient;, then you can skip directly to <link
1074 linkend="ads-test-smbclient">Testing with &smbclient;</link> now. <link
1075 linkend="ads-create-machine-account">Create the Computer Account</link> and <link
1076 linkend="ads-test-server">Testing Server Setup</link> are needed only if you want Kerberos support for &smbd;
1082 <sect2 id="ads-create-machine-account">
1083 <title>Create the Computer Account</title>
1086 <indexterm><primary>write permission</primary></indexterm>
1087 <indexterm><primary>Samba private directory</primary></indexterm>
1088 <indexterm><primary>Administrator account</primary></indexterm>
1089 <indexterm><primary>ADS</primary></indexterm>
1090 As a user who has write permission on the Samba private directory (usually root), run:
1092 &rootprompt; <userinput>net ads join -U Administrator%password</userinput>
1094 The Administrator account can be any account that has been designated in the ADS domain security settings with
1095 permission to add machines to the ADS domain. It is, of course, a good idea to use an account other than Administrator.
1096 On the UNIX/Linux system, this command must be executed by an account that has UID=0 (root).
1100 <indexterm><primary>ADS</primary></indexterm>
1101 <indexterm><primary>machine trust account</primary></indexterm>
1102 <indexterm><primary>organizational unit</primary></indexterm>
1103 <indexterm><primary>ADS manager</primary></indexterm>
1104 <indexterm><primary>kinit</primary></indexterm>
1105 <indexterm><primary>net</primary><secondary>ads</secondary><tertiary>join</tertiary></indexterm>
1106 When making a Windows client a member of an ADS domain within a complex organization, you
1107 may want to create the machine trust account within a particular organizational unit. Samba-3 permits
1108 this to be done using the following syntax:
1110 &rootprompt; <userinput>kinit Administrator@your.kerberos.REALM</userinput>
1111 &rootprompt; <userinput>net ads join createcomputer="organizational_unit"</userinput>
1113 Your ADS manager will be able to advise what should be specified for the "organizational_unit" parameter.
1117 <indexterm><primary>organizational directory</primary></indexterm>
1118 <indexterm><primary>machine trust account</primary></indexterm>
1119 <indexterm><primary>container</primary></indexterm>
1120 <indexterm><primary>ADS</primary></indexterm>
1121 For example, you may want to create the machine trust account in a container called <quote>Servers</quote>
1122 under the organizational directory <quote>Computers/BusinessUnit/Department,</quote> like this:
1124 &rootprompt; <userinput>net ads join "Computers/BusinessUnit/Department/Servers"</userinput>
1126 This command will place the Samba server machine trust account in the container
1127 <literal>Computers/BusinessUnit/Department/Servers</literal>. The container should exist in the ADS directory
1128 before executing this command. Please note that forward slashes must be used, because backslashes are both
1129 valid characters in an OU name and used as escapes for other characters. If you need a backslash in an OU
1130 name, it may need to be quadrupled to pass through the shell escape and ldap escape.
1134 <title>Possible Errors</title>
1138 <varlistentry><term><errorname>ADS support not compiled in</errorname></term>
1140 <indexterm><primary>config.cache</primary></indexterm>
1141 <indexterm><primary>Kerberos</primary></indexterm>
1142 <indexterm><primary>headers files</primary></indexterm>
1143 Samba must be reconfigured (remove config.cache) and recompiled (make clean all install) after the
1144 Kerberos libraries and headers files are installed.
1145 </para></listitem></varlistentry>
1147 <varlistentry><term><errorname>net ads join prompts for user name</errorname></term>
1149 <indexterm><primary>kinit</primary></indexterm>
1150 <indexterm><primary>rights</primary></indexterm>
1151 You need to log in to the domain using <userinput>kinit
1152 <replaceable>USERNAME</replaceable>@<replaceable>REALM</replaceable></userinput>.
1153 <replaceable>USERNAME</replaceable> must be a user who has rights to add a machine to the domain.
1154 </para></listitem></varlistentry>
1156 <varlistentry><term>Unsupported encryption/or checksum types</term>
1158 <indexterm><primary>/etc/krb5.conf</primary></indexterm>
1159 <indexterm><primary>unsupported encryption</primary></indexterm>
1160 <indexterm><primary>Kerberos</primary></indexterm>
1161 Make sure that the <filename>/etc/krb5.conf</filename> is correctly configured
1162 for the type and version of Kerberos installed on the system.
1163 </para></listitem></varlistentry>
1171 <sect2 id="ads-test-server">
1172 <title>Testing Server Setup</title>
1175 <indexterm><primary>successful join</primary></indexterm>
1176 <indexterm><primary>computer account</primary></indexterm>
1177 <indexterm><primary>ADS</primary></indexterm>
1178 If the join was successful, you will see a new computer account with the
1179 NetBIOS name of your Samba server in Active Directory (in the <quote>Computers</quote>
1180 folder under Users and Computers.
1184 <indexterm><primary>Windows 2000</primary></indexterm>
1185 <indexterm><primary>net</primary><secondary>use</secondary></indexterm>
1186 <indexterm><primary>DES-CBC-MD5</primary></indexterm>
1187 On a Windows 2000 client, try <userinput>net use * \\server\share</userinput>. You should
1188 be logged in with Kerberos without needing to know a password. If this fails, then run
1189 <userinput>klist tickets</userinput>. Did you get a ticket for the server? Does it have
1190 an encryption type of DES-CBC-MD5?
1194 <indexterm><primary>DES-CBC-MD5</primary></indexterm>
1195 <indexterm><primary>ARCFOUR-HMAC-MD5</primary></indexterm>
1196 <indexterm><primary>encoding</primary></indexterm>
1197 Samba can use both DES-CBC-MD5 encryption as well as ARCFOUR-HMAC-MD5 encoding.
1202 <sect2 id="ads-test-smbclient">
1203 <title>Testing with &smbclient;</title>
1206 <indexterm><primary>smbclient</primary></indexterm>
1207 <indexterm><primary>Kerberos</primary></indexterm>
1208 <indexterm><primary>Kerberos authentication</primary></indexterm>
1209 On your Samba server try to log in to a Windows 2000 server or your Samba
1210 server using &smbclient; and Kerberos. Use &smbclient; as usual, but
1211 specify the <option>-k</option> option to choose Kerberos authentication.
1217 <title>Notes</title>
1220 <indexterm><primary>administrator password</primary></indexterm>
1221 <indexterm><primary>change password</primary></indexterm>
1222 <indexterm><primary>encryption types</primary></indexterm>
1223 You must change the administrator password at least once after installing a domain controller,
1224 to create the right encryption types.
1228 <indexterm><primary>_kerberos._udp</primary></indexterm>
1229 <indexterm><primary>_ldap._tcp</primary></indexterm>
1230 <indexterm><primary>default DNS setup</primary></indexterm>
1231 Windows 200x does not seem to create the <parameter>_kerberos._udp</parameter> and
1232 <parameter>_ldap._tcp</parameter> in the default DNS setup. Perhaps this will be fixed later in service packs.
1239 <title>Sharing User ID Mappings between Samba Domain Members</title>
1242 <indexterm><primary>maps UNIX users and groups</primary></indexterm>
1243 <indexterm><primary>UID</primary></indexterm>
1244 <indexterm><primary>GID</primary></indexterm>
1245 <indexterm><primary>SID</primary></indexterm>
1246 Samba maps UNIX users and groups (identified by UIDs and GIDs) to Windows users and groups (identified by SIDs).
1247 These mappings are done by the <parameter>idmap</parameter> subsystem of Samba.
1251 <indexterm><primary>mappings</primary></indexterm>
1252 <indexterm><primary>CIFS</primary></indexterm>
1253 <indexterm><primary>NFS</primary></indexterm>
1254 In some cases it is useful to share these mappings between Samba domain members,
1255 so <emphasis>name->id</emphasis> mapping is identical on all machines.
1256 This may be needed in particular when sharing files over both CIFS and NFS.
1260 <indexterm><primary>LDAP</primary></indexterm>
1261 <indexterm><primary>ldap idmap suffix</primary></indexterm>
1262 To use the <emphasis>LDAP</emphasis> <parameter>ldap idmap suffix</parameter>, set:
1266 <smbconfoption name="ldap idmap suffix">ou=Idmap</smbconfoption>
1270 See the &smb.conf; man page entry for the <smbconfoption name="ldap idmap suffix"></smbconfoption>
1271 parameter for further information.
1275 <indexterm><primary>smbpasswd</primary></indexterm>
1276 <indexterm><primary>LDAP administrative password</primary></indexterm>
1277 <indexterm><primary>secrets.tdb</primary></indexterm>
1278 Do not forget to specify also the <smbconfoption name="ldap admin dn"/>
1279 and to make certain to set the LDAP administrative password into the <filename>secrets.tdb</filename> using:
1281 &rootprompt; smbpasswd -w ldap-admin-password
1283 In place of <literal>ldap-admin-password</literal>, substitute the LDAP administration password for your
1290 <title>Common Errors</title>
1293 <indexterm><primary>domain member</primary></indexterm>
1294 <indexterm><primary>machine trust accounts</primary></indexterm>
1295 In the process of adding/deleting/re-adding domain member machine trust accounts, there are
1296 many traps for the unwary player and many <quote>little</quote> things that can go wrong.
1297 It is particularly interesting how often subscribers on the Samba mailing list have concluded
1298 after repeated failed attempts to add a machine account that it is necessary to <quote>reinstall</quote>
1299 MS Windows on the machine. In truth, it is seldom necessary to reinstall because of this type
1300 of problem. The real solution is often quite simple, and with an understanding of how MS Windows
1301 networking functions, it is easy to overcome.
1305 <title>Cannot Add Machine Back to Domain</title>
1308 <indexterm><primary>machine trust account</primary></indexterm>
1309 <indexterm><primary>already exists</primary></indexterm>
1310 <quote>A Windows workstation was reinstalled. The original domain machine trust
1311 account was deleted and added immediately. The workstation will not join the domain if I use
1312 the same machine name. Attempts to add the machine fail with a message that the machine already
1313 exists on the network &smbmdash; I know it does not. Why is this failing?</quote>
1317 <indexterm><primary>NetBIOS name cache</primary></indexterm>
1318 <indexterm><primary>nbtstat</primary></indexterm>
1319 The original name is still in the NetBIOS name cache and must expire after machine account
1320 deletion before adding that same name as a domain member again. The best advice is to delete
1321 the old account and then add the machine with a new name. Alternately, the name cache can be flushed and
1322 reloaded with current data using the <command>nbtstat</command> command on the Windows client:
1324 &dosprompt; nbtstat -R
1331 <title>Adding Machine to Domain Fails</title>
1334 <indexterm><primary>PDC</primary></indexterm>
1335 <indexterm><primary>fails</primary></indexterm>
1336 <quote>Adding a Windows 200x or XP Professional machine to the Samba PDC Domain fails with a
1337 message that says, <errorname>"The machine could not be added at this time, there is a network problem.
1338 Please try again later."</errorname> Why?</quote>
1342 <indexterm><primary>check logs</primary></indexterm>
1343 You should check that there is an <smbconfoption name="add machine script"/> in your &smb.conf;
1344 file. If there is not, please add one that is appropriate for your OS platform. If a script
1345 has been defined, you will need to debug its operation. Increase the <smbconfoption name="log level"></smbconfoption>
1346 in the &smb.conf; file to level 10, then try to rejoin the domain. Check the logs to see which
1347 operation is failing.
1351 Possible causes include:
1356 <indexterm><primary>script</primary></indexterm>
1357 <indexterm><primary>path specified</primary></indexterm>
1358 The script does not actually exist, or could not be located in the path specified.
1362 <indexterm><primary>UNIX system account</primary></indexterm>
1363 <indexterm><primary>Samba SAM account</primary></indexterm>
1364 <emphasis>Corrective action:</emphasis> Fix it. Make sure when run manually
1365 that the script will add both the UNIX system account and the Samba SAM account.
1369 <indexterm><primary>UNIX system account</primary></indexterm>
1370 <indexterm><primary>/etc/passwd</primary></indexterm>
1371 The machine could not be added to the UNIX system accounts file <filename>/etc/passwd</filename>.
1375 <indexterm><primary>legal UNIX system account name</primary></indexterm>
1376 <indexterm><primary>uppercase</primary></indexterm>
1377 <emphasis>Corrective action:</emphasis> Check that the machine name is a legal UNIX
1378 system account name. If the UNIX utility <command>useradd</command> is called,
1379 then make sure that the machine name you are trying to add can be added using this
1380 tool. <command>Useradd</command> on some systems will not allow any uppercase characters
1381 nor will it allow spaces in the name.
1386 <indexterm><primary>backend database</primary></indexterm>
1387 <indexterm><primary>UNIX system account</primary></indexterm>
1388 <indexterm><primary>Samba backend database</primary></indexterm>
1389 The <smbconfoption name="add machine script"/> does not create the
1390 machine account in the Samba backend database; it is there only to create a UNIX system
1391 account to which the Samba backend database account can be mapped.
1397 <title>I Can't Join a Windows 2003 PDC</title>
1400 <indexterm><primary>SMB signing</primary></indexterm>
1401 <indexterm><primary>SMB</primary></indexterm>
1402 <indexterm><primary>Windows 2003</primary></indexterm>
1403 <indexterm><primary>SMB/CIFS</primary></indexterm>
1404 Windows 2003 requires SMB signing. Client-side SMB signing has been implemented in Samba-3.0.
1405 Set <smbconfoption name="client use spnego">yes</smbconfoption> when communicating
1406 with a Windows 2003 server. This will not interfere with other Windows clients that do not
1407 support the more advanced security features of Windows 2003 because the client will simply
1408 negotiate a protocol that both it and the server suppport. This is a well-known fall-back facility
1409 that is built into the SMB/CIFS protocols.