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