Another partial update. More to follow.
[Samba/gebeck_regimport.git] / docs / Samba3-HOWTO / TOSHARG-BDC.xml
blob5a62de8e86a872762a9e8becc689a2eeba019d1d
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="samba-bdc">
5 <chapterinfo>
6         &author.jht;
7         &author.vl;
8         <author>&person.gd;<contrib>LDAP updates</contrib></author>
9 </chapterinfo>
11 <title>Backup Domain Control</title>
13 <para>
14 Before you continue reading this section, please make sure that you are comfortable
15 with configuring a Samba domain controller as described in <link linkend="samba-pdc">Domain Control</link>.
16 </para>
18 <sect1>
19 <title>Features and Benefits</title>
21 <para>
22 This is one of the most difficult chapters to summarize. It does not matter what we say here, for someone will
23 still draw conclusions and/or approach the Samba Team with expectations that are either not yet capable of
24 being delivered or that can be achieved far more effectively using a totally different approach. In the event
25 that you should have a persistent concern that is not addressed in this book, please email <ulink
26 url="mailto:jht@samba.org">John H. Terpstra</ulink> clearly setting out your requirements and/or question, and
27 we will do our best to provide a solution.
28 </para>
30 <para>
31 <indexterm><primary>SAM backend</primary><secondary>LDAP</secondary></indexterm>
32 <indexterm><primary>PDC</primary></indexterm>
33 <indexterm><primary>BDC</primary></indexterm>
34 <indexterm><primary>LDAP</primary><secondary>slave</secondary></indexterm>
35 <indexterm><primary>scalability</primary></indexterm>
36 Samba-3 can act as a Backup Domain Controller (BDC) to another Samba Primary Domain Controller (PDC). A
37 Samba-3 PDC can operate with an LDAP account backend. The LDAP backend can be either a common master LDAP
38 server or a slave server. The use of a slave LDAP server has the benefit that when the master is down, clients
39 may still be able to log onto the network.  This effectively gives Samba a high degree of scalability and is
40 an effective solution for large organizations. If you use an LDAP slave server for a PDC, you will need to
41 ensure the master's continued availability &smbmdash; if the slave finds its master down at the wrong time,
42 you will have stability and operational problems.
43 </para>
45 <para>
46 <indexterm><primary>two-way</primary><secondary>propagation</secondary></indexterm>
47 <indexterm><primary>replication</primary><secondary>SAM</secondary></indexterm>
48 <indexterm><primary>non-LDAP</primary><secondary>backend</secondary></indexterm>
49 While it is possible to run a Samba-3 BDC with a non-LDAP backend, that
50 backend must allow some form of "two-way" propagation of changes
51 from the BDC to the master.  Only LDAP has such capability at this stage.
52 </para>
54 <para>
55 <indexterm><primary>non-LDAP</primary><secondary>backend</secondary></indexterm>
56 <indexterm><primary>SAM backend</primary><secondary>non-LDAP</secondary></indexterm>
57 <indexterm><primary>domain</primary><secondary>member</secondary><tertiary>server</tertiary></indexterm>
58 <indexterm><primary>BDC</primary></indexterm>
59 <indexterm><primary>PDC</primary></indexterm>
60 <indexterm><primary>trust account password</primary></indexterm>
61 <indexterm><primary>domain trust</primary></indexterm>
62 The use of a non-LDAP backend SAM database is particularly problematic because domain member
63 servers and workstations periodically change the Machine Trust Account password. The new
64 password is then stored only locally. This means that in the absence of a centrally stored
65 accounts database (such as that provided with an LDAP-based solution) if Samba-3 is running
66 as a BDC, the BDC instance of the domain member trust account password will not reach the
67 PDC (master) copy of the SAM. If the PDC SAM is then replicated to BDCs, this results in 
68 overwriting the SAM that contains the updated (changed) trust account password with resulting
69 breakage of the domain trust.
70 </para>
72 <para>
73 <indexterm><primary>net</primary><secondary>rpc</secondary></indexterm>
74 <indexterm><primary>SAM backend</primary><secondary>ldapsam</secondary></indexterm>
75 <indexterm><primary>SAM backend</primary><secondary>tdbsam</secondary></indexterm>
76 <indexterm><primary>replication</primary><secondary>SAM</secondary></indexterm>
77 Considering the number of comments and questions raised concerning how to configure a BDC,
78 let's consider each possible option and look at the pros and cons for each possible solution.
79 <link linkend="pdc-bdc-table">The Domain Backend Account Distribution Options table below</link> lists 
80 possible design configurations for a PDC/BDC infrastructure.
81 </para>
83 <table frame="all" id="pdc-bdc-table"><title>Domain Backend Account Distribution Options</title>
84 <tgroup cols="3">
85         <colspec align="center" colwidth="1*"/>
86         <colspec align="center" colwidth="1*"/>
87         <colspec align="left" colwidth="3*"/>
89         <thead>
90         <row><entry>PDC Backend</entry><entry>BDC Backend</entry><entry>Notes/Discussion</entry></row>
91         </thead>
92         <tbody>
93         <row>
94         <entry><para>Master LDAP Server</para></entry>
95         <entry><para>Slave LDAP Server</para></entry>
96         <entry><para>The optimal solution that provides high integrity. The SAM will be
97                 replicated to a common master LDAP server.</para></entry>
98         </row>
99         <row>
100         <entry><para>Single Central LDAP Server</para></entry>
101         <entry><para>Single Central LDAP Server</para></entry>
102         <entry><para>
103         A workable solution without failover ability. This is a usable solution, but not optimal. 
104         </para></entry>
105         </row>
106         <row>
107         <entry><para>tdbsam</para></entry>
108         <entry><para>tdbsam + <command>net rpc vampire</command></para></entry>
109         <entry><para>
110         Does not work with Samba-3.0; Samba does not implement the
111         server-side protocols required.
112         </para></entry>
113         </row>
114         <row>
115         <entry><para>tdbsam</para></entry>
116         <entry><para>tdbsam + <command>rsync</command></para></entry>
117         <entry><para>
118         Do not use this configuration.
119         Does not work because the TDB files are live and data may not
120         have been flushed to disk.  Furthermore, this will cause
121         domain trust breakdown.
122         </para></entry>
123         </row>
124         <row>
125         <entry><para>smbpasswd file</para></entry>
126         <entry><para>smbpasswd file</para></entry>
127         <entry><para>
128         Do not use this configuration.
129         Not an elegant solution due to the delays in synchronization
130         and also suffers
131         from the issue of domain trust breakdown.
132         </para></entry>
133         </row>
134         </tbody>
135 </tgroup>
136 </table>
138 </sect1>
140 <sect1>
141 <title>Essential Background Information</title>
143 <para>
144 A domain controller is a machine that is able to answer logon requests from network
145 workstations. Microsoft LanManager and IBM LanServer were two early products that
146 provided this capability. The technology has become known as the LanMan Netlogon service.
147 </para>
149 <para>
150 When MS Windows NT3.10 was first released, it supported a new style of Domain Control
151 and with it a new form of the network logon service that has extended functionality.
152 This service became known as the NT NetLogon Service. The nature of this service has
153 changed with the evolution of MS Windows NT and today provides a complex array of
154 services that are implemented over an intricate spectrum of technologies.
155 </para>
157 <sect2>
158 <title>MS Windows NT4-style Domain Control</title>
160 <para>
161 Whenever a user logs into a Windows NT4/200x/XP Professional workstation,
162 the workstation connects to a domain controller (authentication server) to validate that
163 the username and password the user entered are valid. If the information entered
164 does not match account information that has been stored in the domain
165 control database (the SAM, or Security Account Manager database), a set of error
166 codes is returned to the workstation that has made the authentication request.
167 </para>
169 <para>
170 When the username/password pair has been validated, the domain controller
171 (authentication server) will respond with full enumeration of the account information
172 that has been stored regarding that user in the user and machine accounts database
173 for that domain. This information contains a complete network access profile for
174 the user but excludes any information that is particular to the user's desktop profile,
175 or for that matter it excludes all desktop profiles for groups that the user may
176 belong to. It does include password time limits, password uniqueness controls,
177 network access time limits, account validity information, machine names from which the
178 user may access the network, and much more. All this information was stored in the SAM
179 in all versions of MS Windows NT (3.10, 3.50, 3.51, 4.0).
180 </para>
182 <para>
183 <indexterm><primary>replication</primary><secondary>SAM</secondary></indexterm>
184 The account information (user and machine) on domain controllers is stored in two files,
185 one containing the security information and the other the SAM. These are stored in files
186 by the same name in the <filename>%SystemRoot%\System32\config</filename> directory. 
187 This normally translates to the path <filename>C:\WinNT\System32\config</filename>. These
188 are the files that are involved in replication of the SAM database where BDCs are present
189 on the network.
190 </para>
192 <para>
193 There are two situations in which it is desirable to install BDCs:
194 </para>
196 <itemizedlist>
197         <listitem><para>
198         On the local network that the PDC is on, if there are many
199         workstations and/or where the PDC is generally very busy. In this case the BDCs
200         will pick up network logon requests and help to add robustness to network services.
201         </para></listitem>
203         <listitem><para>
204         At each remote site, to reduce wide-area network traffic and to add stability to
205         remote network operations. The design of the network, the strategic placement of
206         BDCs, together with an implementation that localizes as much
207         of network to client interchange as possible will help to minimize wide-area network
208         bandwidth needs (and thus costs).
209         </para></listitem>
210 </itemizedlist>
212 <para>
213 The interoperation of a PDC and its BDCs in a true Windows NT4 environment is worth
214 mentioning here. The PDC contains the master copy of the SAM. In the event that an
215 administrator makes a change to the user account database while physically present
216 on the local network that has the PDC, the change will likely be made directly to
217 the PDC instance of the master copy of the SAM. In the event that this update may
218 be performed in a branch office, the change will likely be stored in a delta file
219 on the local BDC. The BDC will then send a trigger to the PDC to commence the process
220 of SAM synchronization. The PDC will then request the delta from the BDC and apply
221 it to the master SAM. The PDC will then contact all the BDCs in the domain and
222 trigger them to obtain the update and then apply that to their own copy of the SAM.
223 </para>
225 <para>
226 Samba-3 cannot participate in true SAM replication and is therefore not able to
227 employ precisely the same protocols used by MS Windows NT4. A Samba-3 BDC will
228 not create SAM update delta files. It will not interoperate with a PDC (NT4 or Samba)
229 to synchronize the SAM from delta files that are held by BDCs.
230 </para>
232 <para>
233 Samba-3 cannot function as a BDC to an MS Windows NT4 PDC, and Samba-3 cannot
234 function correctly as a PDC to an MS Windows NT4 BDC. Both Samba-3 and MS Windows
235 NT4 can function as a BDC to its own type of PDC.
236 </para>
238 <para>
239 The BDC is said to hold a <emphasis>read-only</emphasis> of the SAM from which
240 it is able to process network logon requests and authenticate users. The BDC can
241 continue to provide this service, particularly while, for example, the wide-area
242 network link to the PDC is down. A BDC plays a very important role in both the
243 maintenance of domain security as well as in network integrity.
244 </para>
246 <para>
247 In the event that the NT4 PDC should need to be taken out of service, or if it dies, 
248 one of the NT4 BDCs can be promoted to a PDC. If this happens while the original NT4 PDC
249 is online, it is automatically demoted to an NT4 BDC. This is an important aspect of domain
250 controller management. The tool that is used to effect a promotion or a demotion is the
251 Server Manager for Domains. It should be noted that Samba-3 BDCs cannot be promoted
252 in this manner because reconfiguration of Samba requires changes to the &smb.conf; file.
253 </para>
255 <sect3>
256 <title>Example PDC Configuration</title>
258 <para>
259 Beginning with Version 2.2, Samba officially supports domain logons for all current Windows clients,
260 including Windows NT4, 2003, and XP Professional. For Samba to be enabled as a PDC, some
261 parameters in the <smbconfsection name="[global]"/> section of the &smb.conf; have to be set.
262 Refer to <link linkend="minimalPDC">the Minimal smb.conf for a PDC in Use with a BDC &smbmdash; LDAP Server on
263 PDC section</link> for an example of the minimum required settings.
264 </para>
266 <example id="minimalPDC">
267 <title>Minimal smb.conf for a PDC in Use with a BDC &smbmdash; LDAP Server on PDC</title>
268 <smbconfblock>
269 <smbconfoption name="workgroup">&example.workgroup;</smbconfoption>
270 <smbconfoption name="passdb backend">ldapsam://localhost:389</smbconfoption>
271 <smbconfoption name="domain master">yes</smbconfoption>
272 <smbconfoption name="domain logons">yes</smbconfoption>
273 </smbconfblock>
274 </example>
276 <para>
277 Several other things like a <smbconfsection name="[homes]"/> and a
278 <smbconfsection name="[netlogon]"/> share also need to be set along with
279 settings for the profile path, the user's home drive, and so on. This is not covered in this
280 chapter; for more information please refer to <link linkend="samba-pdc">Domain Control</link>.
281 </para>
283 </sect3>
284 </sect2>
286 <sect2>
287 <title>LDAP Configuration Notes</title>
289 <para>
290 When configuring a master and a slave LDAP server, it is advisable to use the master LDAP server
291 for the PDC and slave LDAP servers for the BDCs. It is not essential to use slave LDAP servers; however,
292 many administrators will want to do so in order to provide redundant services. Of course, one or more BDCs
293 may use any slave LDAP server. Then again, it is entirely possible to use a single LDAP server for the
294 entire network.
295 </para>
297 <para>
298 When configuring a master LDAP server that will have slave LDAP servers, do not forget to configure
299 this in the <filename>/etc/openldap/slapd.conf</filename> file. It must be noted that the DN of a
300 server certificate must use the CN attribute to name the server, and the CN must carry the servers'
301 fully qualified domain name. Additional alias names and wildcards may be present in the
302 subjectAltName certificate extension. More details on server certificate names are in RFC2830.
303 </para>
305 <para>
306 It does not really fit within the scope of this document, but a working LDAP installation is
307 basic to LDAP-enabled Samba operation. When using an OpenLDAP server with Transport Layer Security
308 (TLS), the machine name in <filename>/etc/ssl/certs/slapd.pem</filename> must be the
309 same as in <filename>/etc/openldap/sldap.conf</filename>. The Red Hat Linux startup script
310 creates the <filename>slapd.pem</filename> file with hostname <quote>localhost.localdomain.</quote>
311 It is impossible to access this LDAP server from a slave LDAP server (i.e., a Samba BDC) unless the
312 certificate is re-created with a correct hostname.
313 </para>
315 <para>
316 For preference, do not install a Samba PDC on a OpenLDAP slave server. Joining client machines to the domain
317 will fail in this configuration because the change to the machine account in the LDAP tree
318 must take place on the master LDAP server. This is not replicated rapidly enough to the slave
319 server that the PDC queries. It therefore gives an error message on the client machine about
320 not being able to set up account credentials. The machine account is created on the LDAP server,
321 but the password fields will be empty.  Unfortunately, some sites are
322 unable to avoid such configurations, and these sites should review the
323 <smbconfoption name="ldap replication sleep"/> parameter, intended to slow down Samba sufficiently
324 for the replication to catch up.  This is a kludge, and one that the
325 administrator must manually duplicate in any scripts (such as the
326 <smbconfoption name="add machine script"/>) that
327 they use.
328 </para>
330 <para>
331 Possible PDC/BDC plus LDAP configurations include:
332 </para>
334 <itemizedlist>
335         <listitem><para>
336         PDC+BDC -> One Central LDAP Server.
337         </para></listitem>
338         <listitem><para>
339         PDC -> LDAP master server, BDC -> LDAP slave server.
340         </para></listitem>
341         <listitem><para>
342         PDC -> LDAP master, with secondary slave LDAP server.
343         </para><para>
344         BDC -> LDAP master, with secondary slave LDAP server.
345         </para></listitem>
346         <listitem><para>
347         PDC -> LDAP master, with secondary slave LDAP server.
348         </para><para>
349         BDC -> LDAP slave server, with secondary master LDAP server.
350         </para></listitem>
351 </itemizedlist>
353 <para>
354 In order to have a fallback configuration (secondary) LDAP server, you would specify
355 the secondary LDAP server in the &smb.conf; file as shown in <link linkend="mulitldapcfg">the Multiple LDAP
356 Servers in &smb.conf; example</link>.
357 </para>
359 <example id="mulitldapcfg">
360 <title>Multiple LDAP Servers in &smb.conf;</title>
361 <smbconfblock>
362 <smbconfoption name="passdb backend">ldapsam:"ldap://master.quenya.org ldap://slave.quenya.org"</smbconfoption>
363 </smbconfblock>
364 </example>
366 </sect2>
368 <sect2>
369 <title>Active Directory Domain Control</title>
371 <para>
372 As of the release of MS Windows 2000 and Active Directory, this information is now stored
373 in a directory that can be replicated and for which partial or full administrative control
374 can be delegated. Samba-3 is not able to be a domain controller within an Active Directory
375 tree, and it cannot be an Active Directory server. This means that Samba-3 also cannot
376 act as a BDC to an Active Directory domain controller.
377 </para>
379 </sect2>
381 <sect2>
382 <title>What Qualifies a Domain Controller on the Network?</title>
384 <para>
385 Every machine that is a domain controller for the domain MIDEARTH has to register the NetBIOS
386 group name MIDEARTH&lt;#1c&gt; with the WINS server and/or by broadcast on the local network.
387 The PDC also registers the unique NetBIOS name MIDEARTH&lt;#1b&gt; with the WINS server.
388 The name type &lt;#1b&gt; name is normally reserved for the Domain Master Browser (DMB), a role
389 that has nothing to do with anything related to authentication, but the Microsoft domain
390 implementation requires the DMB to be on the same machine as the PDC.
391 </para>
393 <para>
394 Where a WINS server is not used, broadcast name registrations alone must suffice. Refer to
395 <link linkend="NetworkBrowsing">Network Browsing</link>,<link linkend="netdiscuss">Discussion</link>
396 for more information regarding TCP/IP network protocols and how SMB/CIFS names are handled.
397 </para>
399 </sect2>
401 <sect2>
402 <title>How Does a Workstation find its Domain Controller?</title>
404 <para>
405 There are two different mechanisms to locate a domain controller: one method is used when
406 NetBIOS over TCP/IP is enabled and the other when it has been disabled in the TCP/IP
407 network configuration.
408 </para>
410 <para>
411 Where NetBIOS over TCP/IP is disabled, all name resolution involves the use of DNS, broadcast
412 messaging over UDP, as well as Active Directory communication technologies. In this type of
413 environment all machines require appropriate DNS entries. More information may be found in
414 <link linkend="adsdnstech">DNS and Active Directory</link>.
415 </para>
417 <sect3>
418 <title>NetBIOS Over TCP/IP Enabled</title>
419 <para>
420 An MS Windows NT4/200x/XP Professional workstation in the domain MIDEARTH that wants a
421 local user to be authenticated has to find the domain controller for MIDEARTH. It does this
422 by doing a NetBIOS name query for the group name MIDEARTH&lt;#1c&gt;. It assumes that each
423 of the machines it gets back from the queries is a domain controller and can answer logon
424 requests. To not open security holes, both the workstation and the selected domain controller
425 authenticate each other. After that the workstation sends the user's credentials (name and
426 password) to the local domain controller for validation.
427 </para>
429 </sect3>
431 <sect3>
432 <title>NetBIOS Over TCP/IP Disabled</title>
434 <para>
435 An MS Windows NT4/200x/XP Professional workstation in the realm <constant>quenya.org</constant>
436 that has a need to affect user logon authentication will locate the domain controller by 
437 re-querying DNS servers for the <constant>_ldap._tcp.pdc._msdcs.quenya.org</constant> record.
438 More information regarding this subject may be found in <link linkend="adsdnstech">DNS and Active Directory</link>.
439 </para>
441 </sect3>
442 </sect2>
443 </sect1>
445 <sect1>
446 <title>Backup Domain Controller Configuration</title>
448 <para>
449 The creation of a BDC requires some steps to prepare the Samba server before
450 &smbd; is executed for the first time. These steps are as follows:
451 <indexterm><primary>SID</primary></indexterm>
452 </para>
454 <itemizedlist>
455 <listitem><para>
456         The domain SID has to be the same on the PDC and the BDC. In Samba versions
457         pre-2.2.5, the domain SID was stored in the file <filename>private/MACHINE.SID</filename>.
458         The domain SID is now stored in the file <filename>private/secrets.tdb</filename>. This file
459         is unique to each server and cannot be copied from a PDC to a BDC; the BDC will generate
460         a new SID at startup. It will overwrite the PDC domain SID with the newly created BDC SID.
461         There is a procedure that will allow the BDC to aquire the domain SID. This is described here.
462         </para>
464         <para>
465         To retrieve the domain SID from the PDC or an existing BDC and store it in the
466         <filename>secrets.tdb</filename>, execute:
467         </para>
468 <screen>
469 &rootprompt;<userinput>net rpc getsid</userinput>
470 </screen>
471         </listitem>
473         <listitem><para>
474         Specification of the <smbconfoption name="ldap admin dn"/> is obligatory.
475         This also requires the LDAP administration password to be set in the <filename>secrets.tdb</filename>
476         using the <command>smbpasswd -w <replaceable>mysecret</replaceable></command>.
477         </para></listitem>
479         <listitem><para>
480         Either <smbconfoption name="ldap suffix"/> or
481         <smbconfoption name="ldap idmap suffix"/> must be specified in
482         the &smb.conf; file.
483         </para></listitem>
485         <listitem><para>
486 <indexterm><primary>replication</primary><secondary>SAM</secondary></indexterm>
487         The UNIX user database has to be synchronized from the PDC to the
488         BDC. This means that both the <filename>/etc/passwd</filename> and
489         <filename>/etc/group</filename> have to be replicated from the PDC
490         to the BDC. This can be done manually whenever changes are made. 
491         Alternately, the PDC is set up as an NIS master server and the BDC as an NIS slave
492         server. To set up the BDC as a mere NIS client would not be enough,
493         as the BDC would not be able to access its user database in case of
494         a PDC failure. NIS is by no means the only method to synchronize
495         passwords. An LDAP solution would also work.
496         </para>
497         </listitem>
499         <listitem><para>
500         The Samba password database must be replicated from the PDC to the BDC.
501         Although it is possible to synchronize the <filename>smbpasswd</filename>
502         file with <command>rsync</command> and <command>ssh</command>, this method
503         is broken and flawed, and is therefore not recommended. A better solution
504         is to set up slave LDAP servers for each BDC and a master LDAP server for the PDC.
505         </para></listitem>
507         <listitem><para>
508         The netlogon share has to be replicated from the PDC to the
509         BDC. This can be done manually whenever login scripts are changed,
510         or it can be done automatically using a <command>cron</command> job
511         that will replicate the directory structure in this share using a tool
512         like <command>rsync</command>.
513         </para></listitem>
515 </itemizedlist>
517 <sect2>
518 <title>Example Configuration</title>
520 <para> Finally, the BDC has to be found by the workstations. This can be
521 done by configuring the Samba &smb.conf; file <smbconfsection name="[global]"/> section 
522 as shown in <link linkend="minim-bdc">Minimal Setup for Being a BDC</link>.
523 </para>
525 <example id="minim-bdc">
526 <title>Minimal Setup for Being a BDC</title>
527 <smbconfblock>
528 <smbconfoption name="workgroup">&example.workgroup;</smbconfoption>
529 <smbconfoption name="passdb backend">ldapsam:ldap://slave-ldap.quenya.org</smbconfoption>
530 <smbconfoption name="domain master">no</smbconfoption>
531 <smbconfoption name="domain logons">yes</smbconfoption>
532 <smbconfoption name="idmap backend">ldap:ldap://slave-ldap.quenya.org</smbconfoption>
533 </smbconfblock>
534 </example>
536 <para>
537 This configuration causes the BDC to register only the name MIDEARTH&lt;#1c&gt; with the
538 WINS server. This is not a problem, as the name MIDEARTH&lt;#1c&gt; is a NetBIOS group name
539 that is meant to be registered by more than one machine. The parameter
540 <smbconfoption name="domain master">no</smbconfoption>
541 forces the BDC not to register MIDEARTH&lt;#1b&gt;, which is a unique NetBIOS name that 
542 is reserved for the PDC.
543 </para>
545 <para>
546 <indexterm><primary>idmap backend</primary></indexterm>
547 <indexterm><primary>winbindd</primary></indexterm>
548 The <parameter>idmap backend</parameter> will redirect the <command>winbindd</command> utility to
549 use the LDAP database to resolve all UIDs and GIDs for UNIX accounts.
550 </para>
552 <note><para>
553 <indexterm><primary>Server Type</primary><secondary>Domain Member</secondary></indexterm>
554 Samba-3 has introduced a new ID mapping facility. One of the features of this facility is that it
555 allows greater flexibility in how user and group IDs are handled in respect to NT domain user and group
556 SIDs. One of the new facilities provides for explicitly ensuring that UNIX/Linux UID and GID values
557 will be consistent on the PDC, all BDCs, and all domain member servers. The parameter that controls this
558 is called <parameter>idmap backend</parameter>. Please refer to the man page for &smb.conf; for more information
559 regarding its behavior.
560 </para></note>
562 <para>
563 The use of the <smbconfoption name="idmap backend">ldap:ldap://master.quenya.org</smbconfoption>
564 option on a BDC only makes sense where ldapsam is used on a PDC. The purpose of an LDAP-based idmap backend is
565 also to allow a domain member (without its own passdb backend) to use winbindd to resolve Windows network users
566 and groups to common UID/GIDs. In other words, this option is generally intended for use on BDCs and on domain
567 member servers.
568 </para>
570 </sect2>
571 </sect1>
573 <sect1>
574 <title>Common Errors</title>
576 <para>
577 As domain control is a rather new area for Samba, there are not many examples that we may refer to.
578 Updates will be published as they become available and may be found in later Samba releases or
579 from the Samba Web <ulink url="http://samba.org">site</ulink>.
580 </para>
582 <sect2>
583 <title>Machine Accounts Keep Expiring</title>
585 <para>
586 <indexterm><primary>Machine Trust Accounts</primary></indexterm>
587 This problem will occur when the passdb (SAM) files are copied  from a central
588 server but the local BDC is acting as a PDC. This results in the application of
589 Local Machine Trust Account password updates to the local SAM. Such updates 
590 are not copied back to the central server. The newer machine account password is then
591 overwritten when the SAM is recopied from the PDC. The result is that the domain member machine
592 on startup will find that its passwords do not match the one now in the database, and
593 since the startup security check will now fail, this machine will not allow logon attempts
594 to proceed and the account expiry error will be reported.
595 </para>
597 <para>
598 The solution is to use a more robust passdb backend, such as the ldapsam backend, setting up
599 a slave LDAP server for each BDC and a master LDAP server for the PDC.
600 </para>
602 </sect2>
604 <sect2>
605 <title>Can Samba Be a Backup Domain Controller to an NT4 PDC?</title>
607 <para>
608 <indexterm><primary>replication</primary><secondary>SAM</secondary></indexterm>
609 No. The native NT4 SAM replication protocols have not yet been fully implemented.
610 </para>
612 <para>
613 Can I get the benefits of a BDC with Samba?  Yes, but only to a Samba PDC.The
614 main reason for implementing a BDC is availability. If the PDC is a Samba
615 machine, a second Samba machine can be set up to service logon requests whenever
616 the PDC is down.
617 </para>
619 </sect2>
621 <sect2>
622 <title>How Do I Replicate the smbpasswd File?</title>
624 <para>
625 <indexterm><primary>replication</primary><secondary>SAM</secondary></indexterm>
626 Replication of the smbpasswd file is sensitive. It has to be done whenever changes
627 to the SAM are made. Every user's password change is done in the smbpasswd file and
628 has to be replicated to the BDC. So replicating the smbpasswd file very often is necessary.
629 </para>
631 <para>
632 As the smbpasswd file contains plaintext password equivalents, it must not be
633 sent unencrypted over the wire. The best way to set up smbpasswd replication from
634 the PDC to the BDC is to use the utility rsync. rsync can use ssh as a transport.
635 <command>ssh</command> itself can be set up to accept <emphasis>only</emphasis>
636 <command>rsync</command> transfer without requiring the user to type a password.
637 </para>
639 <para>
640 As said a few times before, use of this method is broken and flawed. Machine trust 
641 accounts will go out of sync, resulting in a broken domain. This method is
642 <emphasis>not</emphasis> recommended. Try using LDAP instead.
643 </para>
645 </sect2>
647 <sect2>
648 <title>Can I Do This All with LDAP?</title>
650 <para>
651 The simple answer is yes. Samba's pdb_ldap code supports binding to a replica
652 LDAP server and will also follow referrals and rebind to the master if it ever
653 needs to make a modification to the database. (Normally BDCs are read-only, so
654 this will not occur often).
655 </para>
657 </sect2>
658 </sect1>
659 </chapter>