source: vendor/current/docs-xml/Samba3-HOWTO/TOSHARG-DomainMember.xml

Last change on this file was 988, checked in by Silvan Scherrer, 9 years ago

Samba Server: update vendor to version 4.4.3

File size: 52.9 KB
Line 
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">
4
5<chapterinfo>
6 &author.jht;
7 &author.jeremy;
8 &author.jerry;
9 &author.tridge;
10 &author.jelmer;
11 <author>&person.gd;<contrib>LDAP updates</contrib></author>
12</chapterinfo>
13
14<title>Domain Membership</title>
15
16<para>
17<indexterm><primary>domain member</primary></indexterm>
18<indexterm><primary>machine trust account</primary></indexterm>
19<indexterm><primary>domain security</primary></indexterm>
20Domain membership is a subject of vital concern. Samba must be able to
21participate as a member server in a Microsoft domain security context, and
22Samba must be capable of providing domain machine member trust accounts;
23otherwise it would not be able to offer a viable option for many users.
24</para>
25
26<para>
27<indexterm><primary>domain membership</primary></indexterm>
28<indexterm><primary>misinformation</primary></indexterm>
29This chapter covers background information pertaining to domain membership,
30the Samba configuration for it, and MS Windows client procedures for joining a
31domain. Why is this necessary? Because both are areas in which there exists
32within the current MS Windows networking world, and particularly in the
33UNIX/Linux networking and administration world, a considerable level of
34misinformation, incorrect understanding, and lack of knowledge. Hopefully
35this chapter will fill the voids.
36</para>
37
38<sect1>
39<title>Features and Benefits</title>
40
41<para>
42<indexterm><primary>domain security</primary></indexterm>
43<indexterm><primary>single sign-on</primary></indexterm>
44<indexterm><primary>SSO</primary></indexterm>
45MS Windows workstations and servers that want to participate in domain security need to
46be made domain members. Participating in domain security is often called
47<emphasis>single sign-on</emphasis>, or <acronym>SSO</acronym> for short. This
48chapter 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>
50server) or a Samba server a member of an MS Windows domain security context.
51</para>
52
53<para>
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>
58Samba can join an MS Windows NT4-style domain as a native member server, an
59MS Windows Active Directory domain as a native member server, or a Samba domain
60control network. Domain membership has many advantages:
61</para>
62
63<itemizedlist>
64 <listitem><para>
65 <indexterm><primary>SAM</primary></indexterm>
66 MS Windows workstation users get the benefit of SSO.
67 </para></listitem>
68
69 <listitem><para>
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).
78 </para></listitem>
79
80 <listitem><para>
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.
85 </para></listitem>
86
87 <listitem><para>
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.
94 </para></listitem>
95
96 <listitem><para>
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.
102 </para></listitem>
103
104 <listitem><para>
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).
114 </para></listitem>
115</itemizedlist>
116
117</sect1>
118
119<sect1 id="machine-trust-accounts">
120<title>MS Windows Workstation/Server Machine Trust Accounts</title>
121
122<para>
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>
127A Machine Trust Account is an account that is used to authenticate a client machine (rather than a user) to
128the domain controller server. In Windows terminology, this is known as a <quote>computer account.</quote> The
129purpose of the machine trust account is to prevent a rogue user and domain controller from colluding to gain
130access to a domain member workstation.
131</para>
132
133<para>
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>
139The password of a Machine Trust Account acts as the shared secret for secure communication with the domain
140controller. This is a security feature to prevent an unauthorized machine with the same NetBIOS name from
141joining the domain, participating in domain security operations, and gaining access to domain user/group
142accounts. Windows NT/200x/XP Professional clients use machine trust accounts, but Windows 9x/Me/XP Home
143clients do not. Hence, a Windows 9x/Me/XP Home client is never a true member of a domain because it does not
144possess a Machine Trust Account, and, thus, has no shared secret with the domain controller.
145</para>
146
147<para>
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>
152A Windows NT4 PDC stores each Machine Trust Account in the Windows Registry.
153The introduction of MS Windows 2000 saw the introduction of Active Directory,
154the new repository for Machine Trust Accounts. A Samba PDC, however, stores
155each Machine Trust Account in two parts,
156as follows:
157
158<itemizedlist>
159 <listitem><para>
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.
166 </para>
167
168 <para>
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.
179 </para>
180
181 <para>
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
188 implemented.
189 </para></listitem>
190
191 <listitem><para>
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, and is not currently planned for release either.
197 </para></listitem>
198</itemizedlist>
199</para>
200
201<?latex \newpage ?>
202<para>
203<indexterm><primary>Machine Trust Accounts</primary><secondary>creating</secondary></indexterm>
204There are three ways to create Machine Trust Accounts:
205</para>
206
207<itemizedlist>
208 <listitem><para>
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.
212 </para></listitem>
213
214 <listitem><para>
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.
221 </para></listitem>
222
223 <listitem><para>
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.
230 </para></listitem>
231</itemizedlist>
232
233<para>
234<indexterm><primary>enforcing</primary></indexterm>
235<indexterm><primary>machine trust account</primary><secondary>creation</secondary></indexterm>
236Neither MS Windows NT4/200x/XP Professional, nor Samba, provide any method for enforcing the method of machine
237trust account creation. This is a matter of the administrator's choice.
238</para>
239
240<sect2>
241<title>Manual Creation of Machine Trust Accounts</title>
242
243<para>
244<indexterm><primary>/etc/passwd</primary></indexterm>
245<indexterm><primary></primary></indexterm>
246<indexterm><primary>useradd</primary></indexterm>
247<indexterm><primary>vipw</primary></indexterm>
248The first step in manually creating a Machine Trust Account is to manually
249create the corresponding UNIX account in <filename>/etc/passwd</filename>.
250This can be done using <command>vipw</command> or another <quote>adduser</quote> command
251that is normally used to create new UNIX accounts. The following is an example for
252a Linux-based Samba server:
253<screen>
254&rootprompt;<userinput>/usr/sbin/useradd -g machines -d /var/lib/nobody \
255 -c <replaceable>"machine nickname"</replaceable> \
256 -s /bin/false <replaceable>machine_name</replaceable>$ </userinput>
257
258&rootprompt;<userinput>passwd -l <replaceable>machine_name</replaceable>$</userinput>
259</screen>
260</para>
261
262<para>
263<indexterm><primary>primary group</primary></indexterm>
264<indexterm><primary>GID</primary></indexterm>
265<indexterm><primary>machine accounts</primary></indexterm>
266In the example above there is an existing system group <quote>machines</quote> which is used
267as the primary group for all machine accounts. In the following examples the <quote>machines</quote> group
268numeric GID is 100.
269</para>
270
271<para>
272<indexterm><primary>chpass</primary></indexterm>
273<indexterm><primary>BSD</primary></indexterm>
274On *BSD systems, this can be done using the <command>chpass</command> utility:
275<screen>
276&rootprompt;<userinput>chpass -a \
277'<replaceable>machine_name</replaceable>$:*:101:100::0:0:Windows <replaceable>machine_name</replaceable>:/dev/null:/sbin/nologin'</userinput>
278</screen>
279</para>
280
281<para>
282<indexterm><primary>/etc/passwd</primary></indexterm>
283<indexterm><primary>$</primary></indexterm>
284<indexterm><primary>null shell</primary></indexterm>
285<indexterm><primary>home directory</primary></indexterm>
286The <filename>/etc/passwd</filename> entry will list the machine name
287with a <quote>$</quote> appended, and will not have a password, will have a null shell and no
288home directory. For example, a machine named <quote>doppy</quote> would have an
289<filename>/etc/passwd</filename> entry like this:
290<programlisting>
291doppy$:x:505:100:<replaceable>machine_nickname</replaceable>:/dev/null:/bin/false
292</programlisting>
293</para>
294
295<para>
296<indexterm><primary>machine_nickname</primary></indexterm>
297<indexterm><primary>machine_name</primary></indexterm>
298<indexterm><primary>Machine Trust Account</primary></indexterm>
299in which <replaceable>machine_nickname</replaceable> can be any
300descriptive name for the client, such as BasementComputer.
301<replaceable>machine_name</replaceable> absolutely must be the NetBIOS
302name of the client to be joined to the domain. The <quote>$</quote> must be
303appended to the NetBIOS name of the client or Samba will not recognize
304this as a Machine Trust Account.
305</para>
306
307<para>
308<indexterm><primary>UNIX account</primary></indexterm>
309<indexterm><primary>Samba account</primary></indexterm>
310<indexterm><primary>Machine Trust Account</primary><secondary>password</secondary></indexterm>
311Now that the corresponding UNIX account has been created, the next step is to create
312the Samba account for the client containing the well-known initial
313Machine Trust Account password. This can be done using the
314<command>smbpasswd</command> command
315as shown here:
316<screen>
317&rootprompt;<userinput>smbpasswd -a -m <replaceable>machine_name</replaceable></userinput>
318</screen>
319</para>
320
321<para>
322<indexterm><primary>machine_name</primary></indexterm>
323<indexterm><primary>NetBIOS name</primary></indexterm>
324<indexterm><primary>RID</primary></indexterm>
325<indexterm><primary>UID</primary></indexterm>
326where <replaceable>machine_name</replaceable> is the machine's NetBIOS
327name. The RID of the new machine account is generated from the UID of
328the corresponding UNIX account.
329</para>
330
331<warning>
332<title>Join the client to the domain immediately</title>
333
334<para>
335<indexterm><primary>Machine Trust Account</primary></indexterm>
336<indexterm><primary>PDC</primary></indexterm>
337<indexterm><primary>Server Manager</primary></indexterm>
338<indexterm><primary>changes password</primary></indexterm>
339<indexterm><primary>NetBIOS name</primary></indexterm>
340Manually creating a Machine Trust Account using this method is the
341equivalent of creating a Machine Trust Account on a Windows NT PDC using
342<indexterm><primary>Server Manager</primary></indexterm>
343the <application>Server Manager</application>. From the time at which the
344account is created to the time the client joins the domain and
345changes the password, your domain is vulnerable to an intruder joining
346your domain using a machine with the same NetBIOS name. A PDC inherently
347trusts members of the domain and will serve out a large degree of user
348information to such clients. You have been warned!
349</para>
350</warning>
351</sect2>
352
353<sect2>
354<title>Managing Domain Machine Accounts using NT4 Server Manager</title>
355
356<para>
357<indexterm><primary>machine trust accounts</primary></indexterm>
358<indexterm><primary>automatic account creation</primary></indexterm>
359<indexterm><primary>Server Manager</primary></indexterm>
360A working <smbconfoption name="add machine script"/> is essential
361for machine trust accounts to be automatically created. This applies no matter whether
362you use automatic account creation or the NT4 Domain Server Manager.
363</para>
364
365<para>
366<indexterm><primary>SRVTOOLS.EXE</primary></indexterm>
367<indexterm><primary>SrvMgr.exe</primary></indexterm>
368<indexterm><primary>UsrMgr.exe</primary></indexterm>
369<indexterm><primary>domain management tools</primary></indexterm>
370If the machine from which you are trying to manage the domain is an
371<application>MS Windows NT4 workstation or MS Windows 200x/XP Professional</application>,
372the tool of choice is the package called <command>SRVTOOLS.EXE</command>.
373When executed in the target directory it will unpack <command>SrvMgr.exe</command>
374and <command>UsrMgr.exe</command> (both are domain management tools for MS Windows NT4 workstation).
375</para>
376
377<para>
378<indexterm><primary>Nexus.exe</primary></indexterm>
379<indexterm><primary>Microsoft Windows 9x/Me</primary></indexterm>
380If your workstation is a <application>Microsoft Windows 9x/Me</application> family product,
381 you should download the <command>Nexus.exe</command> package from the Microsoft Web site.
382When executed from the target directory, it will unpack the same tools but for use on
383this platform.
384</para>
385
386<para>
387Further information about these tools may be obtained from Knowledge Base articles
388<ulink url="http://support.microsoft.com/default.aspx?scid=kb;en-us;173673">173673</ulink>, and
389<ulink url="http://support.microsoft.com/default.aspx?scid=kb;en-us;172540">172540</ulink>
390</para>
391
392<para>
393<indexterm><primary>srvmgr.exe</primary></indexterm>
394<indexterm><primary>Server Manager for Domains</primary></indexterm>
395Launch the <command>srvmgr.exe</command> (Server Manager for Domains) and follow these steps:
396</para>
397
398<procedure>
399<title>Server Manager Account Machine Account Management</title>
400 <step><para>
401 From the menu select <guimenu>Computer</guimenu>.
402 </para></step>
403
404 <step><para>
405 Click <guimenuitem>Select Domain</guimenuitem>.
406 </para></step>
407
408 <step><para>
409 Click the name of the domain you wish to administer in the
410 <guilabel>Select Domain</guilabel> panel and then click
411 <guibutton>OK</guibutton>.
412 </para></step>
413
414 <step><para>
415 Again from the menu select <guimenu>Computer</guimenu>.
416 </para></step>
417
418 <step><para>
419 Select <guimenuitem>Add to Domain</guimenuitem>.
420 </para></step>
421
422 <step><para>
423 In the dialog box, click the radio button to
424 <guilabel>Add NT Workstation of Server</guilabel>, then
425 enter the machine name in the field provided, and click the
426 <guibutton>Add</guibutton> button.
427 </para></step>
428</procedure>
429
430</sect2>
431
432<sect2>
433<title>On-the-Fly Creation of Machine Trust Accounts</title>
434
435<para>
436<indexterm><primary>Machine Trust Account</primary><secondary>creation</secondary></indexterm>
437The third (and recommended) way of creating Machine Trust Accounts is simply to allow the Samba server to
438create them as needed when the client is joined to the domain.
439</para>
440
441<para>
442<indexterm><primary>Machine Trust Account</primary><secondary>UNIX account</secondary></indexterm>
443<indexterm><primary>UNIX account</primary></indexterm>
444<indexterm><primary>add machine script</primary></indexterm>
445Since each Samba Machine Trust Account requires a corresponding UNIX account, a method
446for automatically creating the UNIX account is usually supplied; this requires configuration of the
447add machine script option in &smb.conf;. This method is not required; however, corresponding UNIX
448accounts may also be created manually.
449</para>
450
451
452<para>
453<indexterm><primary>useradd</primary></indexterm>
454<indexterm><primary>Red Hat Linux</primary></indexterm>
455Here is an example for a Red Hat Linux system:
456<smbconfblock>
457<smbconfsection name="[global]"/>
458<smbconfoption name="add machine script">/usr/sbin/useradd -d /var/lib/nobody -g 100 -s /bin/false -M %u</smbconfoption>
459</smbconfblock>
460</para>
461
462</sect2>
463
464<sect2><title>Making an MS Windows Workstation or Server a Domain Member</title>
465
466<para>
467The procedure for making an MS Windows workstation or server a member of the domain varies
468with the version of Windows.
469</para>
470
471<sect3>
472 <title>Windows 200x/XP Professional Client</title>
473
474 <para>
475<indexterm><primary>domain member</primary></indexterm>
476<indexterm><primary>machine trust account</primary><secondary>create privilege</secondary></indexterm>
477<indexterm><primary>privileges</primary></indexterm>
478<indexterm><primary>root</primary></indexterm>
479 When the user elects to make the client a domain member, Windows 200x prompts for
480 an account and password that has privileges to create machine accounts in the domain.
481 </para>
482
483 <para>
484 A Samba administrator account (i.e., a Samba account that has <literal>root</literal> privileges on the
485 Samba server) must be entered here; the operation will fail if an ordinary user account is given.
486 The necessary privilege can be assured by creating a Samba SAM account for <literal>root</literal> or
487 by granting the <literal>SeMachineAccountPrivilege</literal> privilege to the user account.
488 </para>
489
490 <para>
491<indexterm><primary>administrator account</primary></indexterm>
492<indexterm><primary>/etc/passwd</primary></indexterm>
493 For security reasons, the password for this administrator account should be set
494 to a password that is other than that used for the root user in <filename>/etc/passwd</filename>.
495 </para>
496
497 <para>
498<indexterm><primary>account</primary></indexterm>
499<indexterm><primary>create domain member</primary></indexterm>
500<indexterm><primary>root</primary></indexterm>
501<indexterm><primary>map</primary></indexterm>
502 The name of the account that is used to create domain member machine trust accounts can be
503 anything the network administrator may choose. If it is other than <constant>root</constant>,
504 then this is easily mapped to <constant>root</constant> in the file named in the &smb.conf; parameter
505 <smbconfoption name="username map">/etc/samba/smbusers</smbconfoption>.
506 </para>
507
508 <para>
509<indexterm><primary>administrator account</primary></indexterm>
510<indexterm><primary>encryption key</primary></indexterm>
511<indexterm><primary>machine trust account</primary></indexterm>
512 The session key of the Samba administrator account acts as an encryption key for setting the password of the machine trust
513 account. The Machine Trust Account will be created on-the-fly, or updated if it already exists.
514 </para>
515</sect3>
516
517<sect3>
518 <title>Windows NT4 Client</title>
519
520 <para>
521<indexterm><primary>Machine Trust Account</primary></indexterm>
522<indexterm><primary>Create a Computer Account</primary></indexterm>
523<indexterm><primary>join the machine</primary></indexterm>
524 If the Machine Trust Account was created manually, on the
525 Identification Changes menu enter the domain name, but do not
526 check the box <guilabel>Create a Computer Account in the Domain</guilabel>.
527 In this case, the existing Machine Trust Account is used to join the machine
528 to the domain.
529 </para>
530
531 <para>
532<indexterm><primary>Machine Trust Account</primary></indexterm>
533<indexterm><primary>on the fly</primary></indexterm>
534<indexterm><primary>Computer Account</primary></indexterm>
535<indexterm><primary>administrator account</primary></indexterm>
536 If the Machine Trust Account is to be created on the fly, on the Identification Changes menu enter the domain
537 name and check the box <guilabel>Create a Computer Account in the Domain</guilabel>. In this case, joining
538 the domain proceeds as above for Windows 2000 (i.e., you must supply a Samba administrator account when
539 prompted).
540 </para>
541</sect3>
542
543<sect3>
544 <title>Samba Client</title>
545
546 <para>
547<indexterm><primary></primary></indexterm>
548 Joining a Samba client to a domain is documented in <link linkend="domain-member-server">the next section</link>.
549 </para>
550</sect3>
551
552</sect2>
553</sect1>
554
555<sect1 id="domain-member-server">
556<title>Domain Member Server</title>
557
558<para>
559<indexterm><primary>domain security</primary></indexterm>
560<indexterm><primary>security context</primary></indexterm>
561<indexterm><primary>authentication regime</primary></indexterm>
562<indexterm><primary>ADS</primary></indexterm>
563This mode of server operation involves the Samba machine being made a member
564of a domain security context. This means by definition that all user
565authentication will be done from a centrally defined authentication regime.
566The authentication regime may come from an NT3/4-style (old domain technology)
567server, or it may be provided from an Active Directory server (ADS) running on
568MS Windows 2000 or later.
569</para>
570
571<para>
572<emphasis>
573<indexterm><primary>authentication</primary><secondary>backend</secondary></indexterm>
574<indexterm><primary>distributed directory</primary></indexterm>
575<indexterm><primary>LDAP</primary></indexterm>
576<indexterm><primary>OpenLDAP</primary></indexterm>
577<indexterm><primary>iPlanet</primary></indexterm>
578<indexterm><primary>Sun</primary></indexterm>
579<indexterm><primary>Novell</primary></indexterm>
580<indexterm><primary>e-Directory</primary></indexterm>
581Of course it should be clear that the authentication backend itself could be
582from any distributed directory architecture server that is supported by Samba.
583This can be LDAP (from OpenLDAP), or Sun's iPlanet, or Novell e-Directory
584Server, and so on.
585</emphasis>
586</para>
587
588<note><para>
589<indexterm><primary>LDAP</primary></indexterm>
590<indexterm><primary>identity management</primary></indexterm>
591<indexterm><primary>machine authentication</primary></indexterm>
592When Samba is configured to use an LDAP or other identity management and/or
593directory service, it is Samba that continues to perform user and machine
594authentication. It should be noted that the LDAP server does not perform
595authentication handling in place of what Samba is designed to do.
596</para></note>
597
598<para>
599<indexterm><primary>create a domain machine account</primary></indexterm>
600<indexterm><primary>domain member server</primary></indexterm>
601<indexterm><primary>join the domain</primary></indexterm>
602Please refer to <link linkend="samba-pdc">Domain Control</link>, for more information regarding
603how to create a domain machine account for a domain member server as well as for
604information on how to enable the Samba domain member machine to join the domain
605and be fully trusted by it.
606</para>
607
608<sect2>
609<title>Joining an NT4-type Domain with Samba</title>
610
611<para><link linkend="assumptions">Assumptions</link> lists names that are used in the remainder of this chapter.</para>
612
613<table frame="all" id="assumptions"><title>Assumptions</title>
614 <tgroup cols="2">
615 <colspec align="right"/>
616 <colspec align="left"/>
617 <tbody>
618 <row>
619 <entry>Samba DMS NetBIOS name:</entry><entry>SERV1</entry>
620 </row>
621 <row>
622 <entry>Windows 200x/NT domain name:</entry><entry>&example.workgroup;</entry>
623 </row>
624 <row>
625 <entry>Domain's PDC NetBIOS name:</entry><entry>DOMPDC</entry>
626 </row>
627 <row>
628 <entry>Domain's BDC NetBIOS names:</entry><entry>DOMBDC1 and DOMBDC2</entry>
629 </row>
630 </tbody>
631 </tgroup>
632</table>
633
634<para>
635<indexterm><primary></primary></indexterm>
636First, you must edit your &smb.conf; file to tell Samba it should now use domain security.
637</para>
638
639<para>
640<indexterm><primary>security = user</primary></indexterm>
641<indexterm><primary>standalone server</primary></indexterm>
642<indexterm><primary>domain member server</primary></indexterm>
643<indexterm><primary>domain security</primary></indexterm>
644Change (or add) your <smbconfoption name="security"/> line in the [global] section
645of your &smb.conf; to read:
646<smbconfblock>
647<smbconfoption name="security">domain</smbconfoption>
648</smbconfblock>
649Note that if the parameter <parameter>security = user</parameter> is used, this machine would function as a
650standalone server and not as a domain member server. Domain security mode causes Samba to work within the
651domain security context.
652</para>
653
654<para>
655Next change the <smbconfoption name="workgroup"/> line in the <smbconfsection name="[global]"/>
656section to read:
657<smbconfblock>
658<smbconfoption name="workgroup">&example.workgroup;</smbconfoption>
659</smbconfblock>
660This is the name of the domain we are joining.
661</para>
662
663<para>
664<indexterm><primary>authenticate</primary></indexterm>
665<indexterm><primary>PDC</primary></indexterm>
666You must also have the parameter <smbconfoption name="encrypt passwords"/>
667set to <constant>yes</constant> in order for your users to authenticate to the NT PDC.
668This is the default setting if this parameter is not specified. There is no need to specify this
669parameter, but if it is specified in the &smb.conf; file, it must be set to <constant>Yes</constant>.
670</para>
671
672<para>
673<indexterm><primary>PDC</primary></indexterm>
674<indexterm><primary>BDC</primary></indexterm>
675<indexterm><primary>authenticate users</primary></indexterm>
676<indexterm><primary>domain controllers</primary></indexterm>
677Finally, add (or modify) a <smbconfoption name="password server"/> line in the [global]
678section to read:
679<smbconfblock>
680<smbconfoption name="password server">DOMPDC DOMBDC1 DOMBDC2</smbconfoption>
681</smbconfblock>
682These are the PDC and BDCs Samba
683will attempt to contact in order to authenticate users. Samba will
684try to contact each of these servers in order, so you may want to
685rearrange this list in order to spread out the authentication load
686among Domain Controllers.
687</para>
688
689<para>
690<indexterm><primary>list of domain controllers</primary></indexterm>
691<indexterm><primary>mechanism</primary></indexterm>
692<indexterm><primary>broadcast-based name resolution</primary></indexterm>
693<indexterm><primary>DNS name resolution</primary></indexterm>
694Alternatively, if you want smbd to determine automatically the list of domain controllers to use for
695authentication, you may set this line to be:
696<smbconfblock>
697<smbconfoption name="password server">*</smbconfoption>
698</smbconfblock>
699<indexterm><primary>WINS</primary></indexterm>
700This method allows Samba to use exactly the same mechanism that NT does. The
701method either uses broadcast-based name resolution, performs a WINS database
702lookup in order to find a domain controller against which to authenticate,
703or locates the domain controller using DNS name resolution.
704</para>
705
706<para>
707To join the domain, run this command:
708<indexterm><primary>net</primary><secondary>rpc</secondary><tertiary>join</tertiary></indexterm>
709<screen>
710&rootprompt;<userinput>net rpc join -S DOMPDC -U<replaceable>Administrator%password</replaceable></userinput>
711</screen>
712</para>
713
714<para>
715<indexterm><primary>NetBIOS name</primary></indexterm>
716<indexterm><primary>PDC</primary></indexterm>
717<indexterm><primary>WINS lookup</primary></indexterm>
718<indexterm><primary>NetBIOS broadcast</primary></indexterm>
719If the <option>-S DOMPDC</option> argument is not given, the domain name will be obtained from &smb.conf; and
720the NetBIOS name of the PDC will be obtained either using a WINS lookup or via NetBIOS broadcast based name
721look up.
722</para>
723
724<para>
725<indexterm><primary>joining the domain</primary></indexterm>
726<indexterm><primary>PDC</primary></indexterm>
727<indexterm><primary>Administrator%password</primary></indexterm>
728<indexterm><primary>Joined domain</primary></indexterm>
729The machine is joining the domain DOM, and the PDC for that domain (the only machine
730that has write access to the domain SAM database) is DOMPDC; therefore, use the <option>-S</option>
731option. The <replaceable>Administrator%password</replaceable> is the login name and
732password for an account that has the necessary privilege to add machines to the
733domain. If this is successful, you will see the following message in your terminal window.
734Where the older NT4-style domain architecture is used:
735<screen>
736<computeroutput>Joined domain DOM.</computeroutput>
737</screen>
738</para>
739
740<para>
741<indexterm><primary>net</primary><secondary>ads</secondary><tertiary>join</tertiary></indexterm>
742<indexterm><primary>ADS</primary></indexterm>
743<indexterm><primary>join the ADS domain</primary></indexterm>
744Where Active Directory is used, the command used to join the ADS domain is:
745<screen>
746&rootprompt; net ads join -U<replaceable>Administrator%password</replaceable>
747</screen>
748And the following output is indicative of a successful outcome:
749<screen>
750<computeroutput>Joined SERV1 to realm MYREALM.</computeroutput>
751</screen>
752</para>
753
754<para>
755Refer to the <command>net</command> man page and to <link linkend="NetCommand">the chapter on remote
756administration</link> for further information.
757</para>
758
759<para>
760<indexterm><primary>join the domain</primary></indexterm>
761<indexterm><primary>create machine trust account</primary></indexterm>
762<indexterm><primary>PDC</primary></indexterm>
763This process joins the server to the domain without separately having to create the machine
764trust account on the PDC beforehand.
765</para>
766
767<para>
768<indexterm><primary>machine account password</primary><secondary>change protocol</secondary></indexterm>
769<indexterm><primary>random machine account password</primary></indexterm>
770<indexterm><primary>/usr/local/samba/private/secrets.tdb</primary></indexterm>
771<indexterm><primary>/etc/samba/secrets.tdb</primary></indexterm>
772This command goes through the machine account password change protocol, then writes the new (random) machine
773account password for this Samba server into a file in the same directory in which a smbpasswd file would be
774normally stored. The trust account information that is needed by the DMS is written into the file
775<filename>/usr/local/samba/private/secrets.tdb</filename> or <filename>/etc/samba/secrets.tdb</filename>.
776</para>
777
778<para>
779<indexterm><primary>domain-level security</primary></indexterm>
780<indexterm><primary>shadow password file</primary></indexterm>
781This file is created and owned by root and is not readable by any other user. It is
782the key to the domain-level security for your system and should be treated as carefully
783as a shadow password file.
784</para>
785
786<para>
787<indexterm><primary>Samba daemons</primary></indexterm>
788<indexterm><primary>distribution</primary></indexterm>
789<indexterm><primary>/etc/init.d/samba</primary></indexterm>
790Finally, restart your Samba daemons and get ready for clients to begin using domain
791security. The way you can restart your Samba daemons depends on your distribution,
792but in most cases the following will suffice:
793<screen>
794&rootprompt;/etc/init.d/samba restart
795</screen>
796</para>
797
798</sect2>
799
800</sect1>
801
802<sect1 id="ads-member">
803<title>Samba ADS Domain Membership</title>
804
805<para>
806<indexterm significance="preferred"><primary>Active Directory</primary></indexterm>
807<indexterm significance="preferred"><primary>ADS</primary><see>Active Directory</see></indexterm>
808<indexterm><primary>KDC</primary></indexterm>
809<indexterm><primary>Kerberos</primary></indexterm>
810This is a rough guide to setting up Samba with Kerberos authentication against a
811Windows 200x KDC. A familiarity with Kerberos is assumed.
812</para>
813
814<sect2>
815<title>Configure &smb.conf;</title>
816
817<para>
818You must use at least the following three options in &smb.conf;:
819</para>
820
821<smbconfblock>
822<smbconfoption name="realm">your.kerberos.REALM</smbconfoption>
823<smbconfoption name="security">ADS</smbconfoption>
824<smbconfcomment>The following parameter need only be specified if present.</smbconfcomment>
825<smbconfcomment>The default setting if not present is Yes.</smbconfcomment>
826<smbconfoption name="encrypt passwords">yes</smbconfoption>
827</smbconfblock>
828
829<para>
830<indexterm><primary>ADS</primary></indexterm>
831<indexterm><primary>realm</primary></indexterm>
832<indexterm><primary>DNS</primary></indexterm>
833<indexterm><primary>ADS DC</primary></indexterm>
834<indexterm><primary>password server</primary></indexterm>
835In case samba cannot correctly identify the appropriate ADS server using the realm name, use the
836<smbconfoption name="password server"/> option in &smb.conf;:
837<smbconfblock>
838<smbconfoption name="password server">your.kerberos.server</smbconfoption>
839</smbconfblock>
840The most common reason for which Samba may not be able to locate the ADS domain controller is a consequence of
841sites maintaining some DNS servers on UNIX systems without regard for the DNS requirements of the ADS
842infrastructure. There is no harm in specifying a preferred ADS domain controller using the <parameter>password
843server</parameter>.
844</para>
845
846<note><para>
847<indexterm><primary>smbpasswd</primary></indexterm>
848<indexterm><primary>authenticated</primary></indexterm>
849You do <emphasis>not</emphasis> need an smbpasswd file, and older clients will be authenticated as
850if <smbconfoption name="security">domain</smbconfoption>, although it will not do any harm and
851allows you to have local users not in the domain.
852</para></note>
853
854</sect2>
855
856<sect2>
857<title>Configure <filename>/etc/krb5.conf</filename></title>
858
859<para>
860<indexterm><primary>/etc/krb5.conf</primary></indexterm>
861<indexterm><primary>Kerberos</primary><secondary>/etc/krb5.conf</secondary></indexterm>
862<indexterm><primary>MIT</primary></indexterm>
863<indexterm><primary>Heimdal</primary></indexterm>
864With both MIT and Heimdal Kerberos, it is unnecessary to configure the <filename>/etc/krb5.conf</filename>,
865and it may be detrimental.
866</para>
867
868<para>
869<indexterm><primary>ADS</primary></indexterm>
870<indexterm><primary>SRV records</primary></indexterm>
871<indexterm><primary>DNS zon</primary></indexterm>
872<indexterm><primary>KDC</primary></indexterm>
873<indexterm><primary>_kerberos.REALM.NAME</primary></indexterm>
874Microsoft ADS automatically create SRV records in the DNS zone
875<parameter>_kerberos._tcp.REALM.NAME</parameter> for each KDC in the realm. This is part
876of the installation and configuration process used to create an Active Directory domain.
877A KDC is a Kerberos Key Distribution Center and forms an integral part of the Microsoft
878active directory infrastructure.
879</para>
880
881<para>
882<indexterm><primary>kinit</primary></indexterm>
883<indexterm><primary>DES-CBC-MD5</primary></indexterm>
884<indexterm><primary>DES-CBC-CRC</primary></indexterm>
885<indexterm><primary>encryption types</primary></indexterm>
886<indexterm><primary>kerberos</primary></indexterm>
887<indexterm><primary>Windows 2000</primary></indexterm>
888UNIX systems can use kinit and the DES-CBC-MD5 or DES-CBC-CRC encryption types to authenticate to the Windows
8892000 KDC. For further information regarding Windows 2000 ADS kerberos interoperability please refer to the
890Microsoft Windows 2000 Kerberos <ulink
891url="http://www.microsoft.com/windows2000/techinfo/planning/security/kerbsteps.asp">Interoperability</ulink>
892guide. Another very useful document that may be referred to for general information regarding Kerberos
893interoperability is <ulink url="http://www.ietf.org/rfc/rfc1510.txt?number=1510">RFC1510</ulink>. This RFC
894explains much of the magic behind the operation of Kerberos.
895</para>
896
897<para>
898<indexterm><primary>MIT</primary></indexterm>
899<indexterm><primary>KRB5</primary></indexterm>
900<indexterm><primary>SRV records</primary></indexterm>
901<indexterm><primary>krb5.conf</primary></indexterm>
902<indexterm><primary>DNS lookup</primary></indexterm>
903<indexterm><primary>libraries</primary></indexterm>
904MIT's, as well as Heimdal's, recent KRB5 libraries default to checking for SRV records, so they will
905automatically find the KDCs. In addition, <filename>krb5.conf</filename> only allows specifying
906a single KDC, even there if there may be more than one. Using the DNS lookup allows the KRB5
907libraries to use whichever KDCs are available.
908</para>
909
910<para>
911<indexterm><primary>krb5.conf</primary></indexterm>
912When manually configuring <filename>krb5.conf</filename>, the minimal configuration is:
913<screen>
914[libdefaults]
915 default_realm = YOUR.KERBEROS.REALM
916 dns_lookup_kdc = true
917
918[domain_realms]
919 .kerberos.server = YOUR.KERBEROS.REALM
920</screen>
921</para>
922
923<para>
924If you must specify the KDC directly, the minimal configuration is:
925<screen>
926[libdefaults]
927 default_realm = YOUR.KERBEROS.REALM
928
929[realms]
930 YOUR.KERBEROS.REALM = {
931 kdc = your.kerberos.server
932 }
933
934[domain_realms]
935 .kerberos.server = YOUR.KERBEROS.REALM
936</screen>
937</para>
938
939<para>
940<indexterm><primary>KDC</primary></indexterm>
941<indexterm><primary>kinit</primary></indexterm>
942Test your config by doing a <userinput>kinit
943<replaceable>USERNAME</replaceable>@<replaceable>REALM</replaceable></userinput> and
944making sure that your password is accepted by the Win2000 KDC.
945</para>
946
947<note><para>
948<indexterm><primary>realm</primary></indexterm>
949<indexterm><primary>uppercase</primary></indexterm>
950<indexterm><primary>KDC</primary></indexterm>
951The realm must be in uppercase or you will get a <quote><errorname>Cannot find KDC for
952requested realm while getting initial credentials</errorname></quote> error (Kerberos
953is case-sensitive!).
954</para></note>
955
956<note><para>
957<indexterm><primary>synchronize</primary></indexterm>
958<indexterm><primary>credentials</primary></indexterm>
959<indexterm><primary>time difference</primary></indexterm>
960<indexterm><primary>clock skew</primary></indexterm>
961Time between the two servers must be synchronized. You will get a <quote><errorname>kinit(v5): Clock skew too
962great while getting initial credentials</errorname></quote> if the time difference (clock skew) is more than five minutes.
963</para></note>
964
965<para>
966<indexterm><primary>clock skew</primary></indexterm>
967<indexterm><primary>Kerberos</primary></indexterm>
968Clock skew limits are configurable in the Kerberos protocols. The default setting is five minutes.
969</para>
970
971<para>
972<indexterm><primary>Kerberos</primary></indexterm>
973<indexterm><primary>Create the Computer Account</primary></indexterm>
974<indexterm><primary>Testing Server Setup</primary></indexterm>
975<indexterm><primary></primary></indexterm>
976If all you want is Kerberos support in &smbclient;, then you can skip directly to <link
977linkend="ads-test-smbclient">Testing with &smbclient;</link> now. <link
978linkend="ads-create-machine-account">Create the Computer Account</link> and <link
979linkend="ads-test-server">Testing Server Setup</link> are needed only if you want Kerberos support for &smbd;
980and &winbindd;.
981</para>
982
983</sect2>
984
985<sect2 id="ads-create-machine-account">
986<title>Create the Computer Account</title>
987
988<para>
989<indexterm><primary>write permission</primary></indexterm>
990<indexterm><primary>Samba private directory</primary></indexterm>
991<indexterm><primary>Administrator account</primary></indexterm>
992<indexterm><primary>ADS</primary></indexterm>
993As a user who has write permission on the Samba private directory (usually root), run:
994<screen>
995&rootprompt; <userinput>net ads join -U Administrator%password</userinput>
996</screen>
997The Administrator account can be any account that has been designated in the ADS domain security settings with
998permission to add machines to the ADS domain. It is, of course, a good idea to use an account other than Administrator.
999On the UNIX/Linux system, this command must be executed by an account that has UID=0 (root).
1000</para>
1001
1002<para>
1003<indexterm><primary>ADS</primary></indexterm>
1004<indexterm><primary>machine trust account</primary></indexterm>
1005<indexterm><primary>organizational unit</primary></indexterm>
1006<indexterm><primary>ADS manager</primary></indexterm>
1007<indexterm><primary>kinit</primary></indexterm>
1008<indexterm><primary>net</primary><secondary>ads</secondary><tertiary>join</tertiary></indexterm>
1009When making a Windows client a member of an ADS domain within a complex organization, you
1010may want to create the machine trust account within a particular organizational unit. Samba permits
1011this to be done using the following syntax:
1012<screen>
1013&rootprompt; <userinput>kinit Administrator@your.kerberos.REALM</userinput>
1014&rootprompt; <userinput>net ads join createcomputer="organizational_unit"</userinput>
1015</screen>
1016Your ADS manager will be able to advise what should be specified for the "organizational_unit" parameter.
1017</para>
1018
1019<para>
1020<indexterm><primary>organizational directory</primary></indexterm>
1021<indexterm><primary>machine trust account</primary></indexterm>
1022<indexterm><primary>container</primary></indexterm>
1023<indexterm><primary>ADS</primary></indexterm>
1024For example, you may want to create the machine trust account in a container called <quote>Servers</quote>
1025under the organizational directory <quote>Computers/BusinessUnit/Department,</quote> like this:
1026<screen>
1027&rootprompt; <userinput>net ads join "Computers/BusinessUnit/Department/Servers"</userinput>
1028</screen>
1029This command will place the Samba server machine trust account in the container
1030<literal>Computers/BusinessUnit/Department/Servers</literal>. The container should exist in the ADS directory
1031before executing this command. Please note that forward slashes must be used, because backslashes are both
1032valid characters in an OU name and used as escapes for other characters. If you need a backslash in an OU
1033name, it may need to be quadrupled to pass through the shell escape and ldap escape.
1034</para>
1035
1036<sect3>
1037<title>Possible Errors</title>
1038
1039<para>
1040<variablelist>
1041 <varlistentry><term><errorname>ADS support not compiled in</errorname></term>
1042 <listitem><para>
1043 <indexterm><primary>config.cache</primary></indexterm>
1044 <indexterm><primary>Kerberos</primary></indexterm>
1045 <indexterm><primary>headers files</primary></indexterm>
1046 Samba must be reconfigured (remove config.cache) and recompiled (make clean all install) after the
1047 Kerberos libraries and headers files are installed.
1048 </para></listitem></varlistentry>
1049
1050 <varlistentry><term><errorname>net ads join prompts for user name</errorname></term>
1051 <listitem><para>
1052 <indexterm><primary>kinit</primary></indexterm>
1053 <indexterm><primary>rights</primary></indexterm>
1054 You need to login to the domain using <userinput>kinit
1055 <replaceable>USERNAME</replaceable>@<replaceable>REALM</replaceable></userinput>.
1056 <replaceable>USERNAME</replaceable> must be a user who has rights to add a machine to the domain.
1057 </para></listitem></varlistentry>
1058</variablelist>
1059</para>
1060
1061</sect3>
1062
1063</sect2>
1064
1065<sect2 id="ads-test-server">
1066<title>Testing Server Setup</title>
1067
1068<para>
1069<indexterm><primary>successful join</primary></indexterm>
1070<indexterm><primary>computer account</primary></indexterm>
1071<indexterm><primary>ADS</primary></indexterm>
1072If the join was successful, you will see a new computer account with the
1073NetBIOS name of your Samba server in Active Directory (in the <quote>Computers</quote>
1074folder under Users and Computers.
1075</para>
1076
1077<para>
1078<indexterm><primary>Windows 2000</primary></indexterm>
1079<indexterm><primary>net</primary><secondary>use</secondary></indexterm>
1080<indexterm><primary>DES-CBC-MD5</primary></indexterm>
1081On a Windows 2000 client, try <userinput>net use * \\server\share</userinput>. It should be possible
1082to login with Kerberos without needing to know a password. If this fails, then run
1083<userinput>klist tickets</userinput>. Did you get a ticket for the server? Does it have
1084an encryption type of DES-CBC-MD5?
1085</para>
1086
1087<note><para>
1088<indexterm><primary>DES-CBC-MD5</primary></indexterm>
1089<indexterm><primary>ARCFOUR-HMAC-MD5</primary></indexterm>
1090<indexterm><primary>encoding</primary></indexterm>
1091Samba can use both DES-CBC-MD5 encryption as well as ARCFOUR-HMAC-MD5 encoding.
1092</para></note>
1093
1094</sect2>
1095
1096<sect2 id="ads-test-smbclient">
1097<title>Testing with &smbclient;</title>
1098
1099<para>
1100<indexterm><primary>smbclient</primary></indexterm>
1101<indexterm><primary>Kerberos</primary></indexterm>
1102<indexterm><primary>Kerberos authentication</primary></indexterm>
1103On your Samba server try to login to a Windows 2000 server or your Samba
1104server using &smbclient; and Kerberos. Use &smbclient; as usual, but
1105specify the <option>-k</option> option to choose Kerberos authentication.
1106</para>
1107
1108</sect2>
1109</sect1>
1110
1111<sect1>
1112<title>Sharing User ID Mappings between Samba Domain Members</title>
1113
1114<para>
1115<indexterm><primary>maps UNIX users and groups</primary></indexterm>
1116<indexterm><primary>UID</primary></indexterm>
1117<indexterm><primary>GID</primary></indexterm>
1118<indexterm><primary>SID</primary></indexterm>
1119Samba maps UNIX users and groups (identified by UIDs and GIDs) to Windows users and groups (identified by SIDs).
1120These mappings are done by the <parameter>idmap</parameter> subsystem of Samba.
1121</para>
1122
1123<para>
1124<indexterm><primary>mappings</primary></indexterm>
1125<indexterm><primary>CIFS</primary></indexterm>
1126<indexterm><primary>NFS</primary></indexterm>
1127In some cases it is useful to share these mappings between Samba domain members,
1128so <emphasis>name->id</emphasis> mapping is identical on all machines.
1129This may be needed in particular when sharing files over both CIFS and NFS.
1130</para>
1131
1132<para>
1133<indexterm><primary>LDAP</primary></indexterm>
1134<indexterm><primary>ldap idmap suffix</primary></indexterm>
1135To use the <emphasis>LDAP</emphasis> <parameter>ldap idmap suffix</parameter>, set:
1136</para>
1137
1138<smbconfblock>
1139<smbconfoption name="ldap idmap suffix">ou=Idmap</smbconfoption>
1140</smbconfblock>
1141
1142<para>
1143See the &smb.conf; man page entry for the <smbconfoption name="ldap idmap suffix"></smbconfoption>
1144parameter for further information.
1145</para>
1146
1147<para>
1148<indexterm><primary>smbpasswd</primary></indexterm>
1149<indexterm><primary>LDAP administrative password</primary></indexterm>
1150<indexterm><primary>secrets.tdb</primary></indexterm>
1151Do not forget to specify also the <smbconfoption name="ldap admin dn"/>
1152and to make certain to set the LDAP administrative password into the <filename>secrets.tdb</filename> using:
1153<screen>
1154&rootprompt; smbpasswd -w ldap-admin-password
1155</screen>
1156In place of <literal>ldap-admin-password</literal>, substitute the LDAP administration password for your
1157system.
1158</para>
1159
1160</sect1>
1161
1162<sect1>
1163<title>Common Errors</title>
1164
1165<para>
1166<indexterm><primary>domain member</primary></indexterm>
1167<indexterm><primary>machine trust accounts</primary></indexterm>
1168In the process of adding/deleting/re-adding domain member machine trust accounts, there are
1169many traps for the unwary player and many <quote>little</quote> things that can go wrong.
1170It is particularly interesting how often subscribers on the Samba mailing list have concluded
1171after repeated failed attempts to add a machine account that it is necessary to <quote>reinstall</quote>
1172MS Windows on the machine. In truth, it is seldom necessary to reinstall because of this type
1173of problem. The real solution is often quite simple, and with an understanding of how MS Windows
1174networking functions, it is easy to overcome.
1175</para>
1176
1177<sect2>
1178<title>Cannot Add Machine Back to Domain</title>
1179
1180<para>
1181<indexterm><primary>machine trust account</primary></indexterm>
1182<indexterm><primary>already exists</primary></indexterm>
1183<quote>A Windows workstation was reinstalled. The original domain machine trust
1184account was deleted and added immediately. The workstation will not join the domain if I use
1185the same machine name. Attempts to add the machine fail with a message that the machine already
1186exists on the network &smbmdash; I know it does not. Why is this failing?</quote>
1187</para>
1188
1189<para>
1190<indexterm><primary>NetBIOS name cache</primary></indexterm>
1191<indexterm><primary>nbtstat</primary></indexterm>
1192The original name is still in the NetBIOS name cache and must expire after machine account
1193deletion before adding that same name as a domain member again. The best advice is to delete
1194the old account and then add the machine with a new name. Alternately, the name cache can be flushed and
1195reloaded with current data using the <command>nbtstat</command> command on the Windows client:
1196<screen>
1197&dosprompt; nbtstat -R
1198</screen>
1199</para>
1200
1201</sect2>
1202
1203<sect2>
1204<title>Adding Machine to Domain Fails</title>
1205
1206<para>
1207<indexterm><primary>PDC</primary></indexterm>
1208<indexterm><primary>fails</primary></indexterm>
1209<quote>Adding a Windows 200x or XP Professional machine to the Samba PDC Domain fails with a
1210message that says, <errorname>"The machine could not be added at this time, there is a network problem.
1211Please try again later."</errorname> Why?</quote>
1212</para>
1213
1214<para>
1215<indexterm><primary>check logs</primary></indexterm>
1216You should check that there is an <smbconfoption name="add machine script"/> in your &smb.conf;
1217file. If there is not, please add one that is appropriate for your OS platform. If a script
1218has been defined, you will need to debug its operation. Increase the <smbconfoption name="log level"></smbconfoption>
1219in the &smb.conf; file to level 10, then try to rejoin the domain. Check the logs to see which
1220operation is failing.
1221</para>
1222
1223<para>
1224Possible causes include:
1225</para>
1226
1227<itemizedlist>
1228 <listitem><para>
1229<indexterm><primary>script</primary></indexterm>
1230<indexterm><primary>path specified</primary></indexterm>
1231 The script does not actually exist, or could not be located in the path specified.
1232 </para>
1233
1234 <para>
1235<indexterm><primary>UNIX system account</primary></indexterm>
1236<indexterm><primary>Samba SAM account</primary></indexterm>
1237 <emphasis>Corrective action:</emphasis> Fix it. Make sure when run manually
1238 that the script will add both the UNIX system account and the Samba SAM account.
1239 </para></listitem>
1240
1241 <listitem><para>
1242<indexterm><primary>UNIX system account</primary></indexterm>
1243<indexterm><primary>/etc/passwd</primary></indexterm>
1244 The machine could not be added to the UNIX system accounts file <filename>/etc/passwd</filename>.
1245 </para>
1246
1247 <para>
1248<indexterm><primary>legal UNIX system account name</primary></indexterm>
1249<indexterm><primary>uppercase</primary></indexterm>
1250 <emphasis>Corrective action:</emphasis> Check that the machine name is a legal UNIX
1251 system account name. If the UNIX utility <command>useradd</command> is called,
1252 then make sure that the machine name you are trying to add can be added using this
1253 tool. <command>Useradd</command> on some systems will not allow any uppercase characters
1254 nor will it allow spaces in the name.
1255 </para></listitem>
1256</itemizedlist>
1257
1258<para>
1259<indexterm><primary>backend database</primary></indexterm>
1260<indexterm><primary>UNIX system account</primary></indexterm>
1261<indexterm><primary>Samba backend database</primary></indexterm>
1262The <smbconfoption name="add machine script"/> does not create the
1263machine account in the Samba backend database; it is there only to create a UNIX system
1264account to which the Samba backend database account can be mapped.
1265</para>
1266
1267</sect2>
1268</sect1>
1269</chapter>
Note: See TracBrowser for help on using the repository browser.