This commit was manufactured by cvs2svn to create branch 'SAMBA_3_0'.
[samba.git] / docs / htmldocs / samba-bdc.html
1 <html><head><meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1"><title>Chapter 6. Backup Domain Control</title><link rel="stylesheet" href="samba.css" type="text/css"><meta name="generator" content="DocBook XSL Stylesheets V1.60.1"><link rel="home" href="index.html" title="SAMBA Project Documentation"><link rel="up" href="type.html" title="Part II. Server Configuration Basics"><link rel="previous" href="samba-pdc.html" title="Chapter 5. Domain Control"><link rel="next" href="domain-member.html" title="Chapter 7. Domain Membership"></head><body bgcolor="white" text="black" link="#0000FF" vlink="#840084" alink="#0000FF"><div class="navheader"><table width="100%" summary="Navigation header"><tr><th colspan="3" align="center">Chapter 6. Backup Domain Control</th></tr><tr><td width="20%" align="left"><a accesskey="p" href="samba-pdc.html">Prev</a> </td><th width="60%" align="center">Part II. Server Configuration Basics</th><td width="20%" align="right"> <a accesskey="n" href="domain-member.html">Next</a></td></tr></table><hr></div><div class="chapter" lang="en"><div class="titlepage"><div><div><h2 class="title"><a name="samba-bdc"></a>Chapter 6. Backup Domain Control</h2></div><div><div class="author"><h3 class="author"><span class="firstname">John</span> <span class="othername">H.</span> <span class="surname">Terpstra</span></h3><div class="affiliation"><span class="orgname">Samba Team<br></span><div class="address"><p><tt class="email">&lt;<a href="mailto:jht@samba.org">jht@samba.org</a>&gt;</tt></p></div></div></div></div><div><div class="author"><h3 class="author"><span class="firstname">Volker</span> <span class="surname">Lendecke</span></h3><div class="affiliation"><span class="orgname">Samba Team<br></span><div class="address"><p><tt class="email">&lt;<a href="mailto:Volker.Lendecke@SerNet.DE">Volker.Lendecke@SerNet.DE</a>&gt;</tt></p></div></div></div></div><div><div class="author"><h3 class="author"><span class="firstname">Guenther</span> <span class="surname">Deschner</span></h3><span class="contrib">LDAP updates</span><div class="affiliation"><span class="orgname">SuSE<br></span><div class="address"><p><tt class="email">&lt;<a href="mailto:gd@suse.de">gd@suse.de</a>&gt;</tt></p></div></div></div></div></div><div></div></div><div class="toc"><p><b>Table of Contents</b></p><dl><dt><a href="samba-bdc.html#id2891162">Features and Benefits</a></dt><dt><a href="samba-bdc.html#id2891552">Essential Background Information</a></dt><dd><dl><dt><a href="samba-bdc.html#id2891580">MS Windows NT4-style Domain Control</a></dt><dt><a href="samba-bdc.html#id2891874">LDAP Configuration Notes</a></dt><dt><a href="samba-bdc.html#id2892094">Active Directory Domain Control</a></dt><dt><a href="samba-bdc.html#id2892115">What Qualifies a Domain Controller on the Network?</a></dt><dt><a href="samba-bdc.html#id2892157">How does a Workstation find its Domain Controller?</a></dt></dl></dd><dt><a href="samba-bdc.html#id2892268">Backup Domain Controller Configuration</a></dt><dd><dl><dt><a href="samba-bdc.html#id2892538">Example Configuration</a></dt></dl></dd><dt><a href="samba-bdc.html#id2892768">Common Errors</a></dt><dd><dl><dt><a href="samba-bdc.html#id2892791">Machine Accounts Keep Expiring</a></dt><dt><a href="samba-bdc.html#id2892845">Can Samba Be a Backup Domain Controller to an NT4 PDC?</a></dt><dt><a href="samba-bdc.html#id2892880">How Do I Replicate the smbpasswd File?</a></dt><dt><a href="samba-bdc.html#id2892948">Can I Do This All with LDAP?</a></dt></dl></dd></dl></div><p>
2 Before you continue reading this section, please make sure that you are comfortable
3 with configuring a Samba Domain Controller as described in <link linkend="samba-pdc">.
4 </p><div class="sect1" lang="en"><div class="titlepage"><div><div><h2 class="title" style="clear: both"><a name="id2891162"></a>Features and Benefits</h2></div></div><div></div></div><p>
5 This is one of the most difficult chapters to summarize. It does not matter what we say here
6 for someone will still draw conclusions and/or approach the Samba Team with expectations
7 that are either not yet capable of being delivered, or that can be achieved far more
8 effectively using a totally different approach. In the event that you should have a persistent
9 concern that is not addressed in this book, please email <ulink url="mailto:jht@samba.org">John H. Terpstra</ulink>
10 clearly setting out your requirements and/or question and we will do our best to provide a solution.
11 </p><p>
12 <a class="indexterm" name="id2891195"></a>
13 Samba-3 is capable of acting as a Backup Domain Controller (BDC) to another Samba Primary Domain
14 Controller (PDC). A Samba-3 PDC can operate with an LDAP Account backend. The LDAP backend can be
15 either a common master LDAP server, or a slave server. The use of a slave LDAP server has the
16 benefit that when the master is down, clients may still be able to log onto the network.
17 This effectively gives Samba a high degree of scalability and is an effective solution
18 for large organizations. Do not use an LDAP slave server for a PDC, this may cause serious
19 stability and operational problems.
20 </p><p>
21 <a class="indexterm" name="id2891221"></a>
22 While it is possible to run a Samba-3 BDC with non-LDAP backend, the administrator will
23 need to figure out precisely what is the best way to replicate (copy/distribute) the
24 user and machine accounts' backend.
25 </p><p>
26 <a class="indexterm" name="id2891240"></a>
27 The use of a non-LDAP backend SAM database is particularly problematic because Domain Member
28 servers and workstations periodically change the Machine Trust Account password. The new
29 password is then stored only locally. This means that in the absence of a centrally stored
30 accounts database (such as that provided with an LDAP-based solution) if Samba-3 is running
31 as a BDC, the BDC instance of the Domain Member trust account password will not reach the
32 PDC (master) copy of the SAM. If the PDC SAM is then replicated to BDCs, this results in 
33 overwriting the SAM that contains the updated (changed) trust account password with resulting
34 breakage of the domain trust.
35 </p><p>
36 Considering the number of comments and questions raised concerning how to configure a BDC,
37 let's consider each possible option and look at the pros and cons for each possible solution.
38 <link linkend="pdc-bdc-table"> lists possible design configurations for a PDC/BDC infrastructure.
39 <a class="indexterm" name="id2891281"></a>
40 <a class="indexterm" name="id2891291"></a>
41 <a class="indexterm" name="id2891302"></a>
42 <a class="indexterm" name="id2891313"></a>
43 </p><div class="table"><a name="pdc-bdc-table"></a><p class="title"><b>Table 6.1. Domain Backend Account Distribution Options</b></p><table summary="Domain Backend Account Distribution Options" border="1"><colgroup><col align="center"><col align="center"><col align="left"></colgroup><thead><tr><th align="center">PDC Backend</th><th align="center">BDC Backend</th><th align="left">Notes/Discussion</th></tr></thead><tbody><tr><td align="center"><p>Master LDAP Server</p></td><td align="center"><p>Slave LDAP Server</p></td><td align="left"><p>The optimal solution that provides high integrity. The SAM will be
44                 replicated to a common master LDAP server.</p></td></tr><tr><td align="center"><p>Single Central LDAP Server</p></td><td align="center"><p>Single Central LDAP Server</p></td><td align="left"><p>
45         A workable solution without fail-over ability. This is a useable solution, but not optimal. 
46         </p></td></tr><tr><td align="center"><p>tdbsam</p></td><td align="center"><p>tdbsam + <b class="command">net rpc vampire</b></p></td><td align="left"><p>
47         Does not work with Samba-3.0.0; may be implemented in a later release. The downside of this solution
48         is that an external process will control account database integrity. This solution may appeal to sites
49         that wish to avoid the complexity of LDAP. The <b class="command">net rpc vampire</b> is used to
50         synchronize domain accounts from the PDC to the BDC.
51         </p></td></tr><tr><td align="center"><p>tdbsam</p></td><td align="center"><p>tdbsam + <b class="command">rsync</b></p></td><td align="left"><p>
52         Do not use this configuration.
53         Does not work because the TDB files are live and data may not have been flushed to disk.
54         Use <b class="command">rsync</b> to synchronize the TDB database files from the PDC to the BDC.
55         </p></td></tr><tr><td align="center"><p>smbpasswd file</p></td><td align="center"><p>smbpasswd file</p></td><td align="left"><p>
56         Do not use this configuration.
57         Not an elegant solution due to the delays in synchronization.
58         Use <b class="command">rsync</b> to synchronize the TDB database files from the PDC to the BDC.
59         Can be made to work using a <b class="command">cron</b> job to synchronize data from the PDC to the BDC.
60         </p></td></tr></tbody></table></div></div><div class="sect1" lang="en"><div class="titlepage"><div><div><h2 class="title" style="clear: both"><a name="id2891552"></a>Essential Background Information</h2></div></div><div></div></div><p>
61 A Domain Controller is a machine that is able to answer logon requests from network
62 workstations. Microsoft LanManager and IBM LanServer were two early products that
63 provided this capability. The technology has become known as the LanMan Netlogon service.
64 </p><p>
65 When MS Windows NT3.10 was first released, it supported a new style of Domain Control
66 and with it a new form of the network logon service that has extended functionality.
67 This service became known as the NT NetLogon Service. The nature of this service has
68 changed with the evolution of MS Windows NT and today provides a complex array of
69 services that are implemented over an intricate spectrum of technologies.
70 </p><div class="sect2" lang="en"><div class="titlepage"><div><div><h3 class="title"><a name="id2891580"></a>MS Windows NT4-style Domain Control</h3></div></div><div></div></div><p>
71 Whenever a user logs into a Windows NT4/200x/XP Professional Workstation,
72 the workstation connects to a Domain Controller (authentication server) to validate that
73 the username and password the user entered are valid. If the information entered
74 does not match account information that has been stored in the Domain
75 Control database (the SAM, or Security Account Manager database), a set of error
76 codes is returned to the workstation that has made the authentication request.
77 </p><p>
78 When the username/password pair has been validated, the Domain Controller
79 (authentication server) will respond with full enumeration of the account information
80 that has been stored regarding that user in the User and Machine Accounts database
81 for that Domain. This information contains a complete network access profile for
82 the user but excludes any information that is particular to the user's desktop profile,
83 or for that matter it excludes all desktop profiles for groups that the user may
84 belong to. It does include password time limits, password uniqueness controls,
85 network access time limits, account validity information, machine names from which the
86 user may access the network, and much more. All this information was stored in the SAM
87 in all versions of MS Windows NT (3.10, 3.50, 3.51, 4.0).
88 </p><p>
89 <a class="indexterm" name="id2891624"></a>
90 The account information (user and machine) on Domain Controllers is stored in two files,
91 one containing the Security information and the other the SAM. These are stored in files
92 by the same name in the <tt class="filename">C:\Windows NT\System32\config</tt> directory. These
93 are the files that are involved in replication of the SAM database where Backup Domain
94 Controllers are present on the network.
95 </p><p>
96 There are two situations in which it is desirable to install Backup Domain Controllers:
97 </p><div class="itemizedlist"><ul type="disc"><li><p>
98         On the local network that the Primary Domain Controller is on, if there are many
99         workstations and/or where the PDC is generally very busy. In this case the BDCs
100         will pick up network logon requests and help to add robustness to network services.
101         </p></li><li><p>
102         At each remote site, to reduce wide area network traffic and to add stability to
103         remote network operations. The design of the network, the strategic placement of
104         Backup Domain Controllers, together with an implementation that localizes as much
105         of network to client interchange as possible will help to minimize wide area network
106         bandwidth needs (and thus costs).
107         </p></li></ul></div><p>
108 The inter-operation of a PDC and its BDCs in a true Windows NT4 environemt is worth
109 mentioning here. The PDC contains the master copy of the SAM. In the event that an
110 administrator makes a change to the user account database while physically present
111 on the local network that has the PDC, the change will likely be made directly to
112 the PDC instance of the master copy of the SAM. In the event that this update may
113 be performed in a branch office, the change will likely be stored in a delta file
114 on the local BDC. The BDC will then send a trigger to the PDC to commence the process
115 of SAM synchronization. The PDC will then request the delta from the BDC and apply
116 it to the master SAM. The PDC will then contact all the BDCs in the Domain and
117 trigger them to obtain the update and then apply that to their own copy of the SAM.
118 </p><p>
119 Samba-3 can not participate in true SAM replication and is therefore not able to
120 employ precisely the same protocols used by MS Windows NT4. A Samba-3 BDC will
121 not create SAM update delta files. It will not inter-operate with a PDC (NT4 or Samba)
122 to synchronize the SAM from delta files that are held by BDCs.
123 </p><p>
124 Samba-3 cannot function as a BDC to an MS Windows NT4 PDC, and Samba-3 can not
125 function correctly as a PDC to an MS Windows NT4 BDC. Both Samba-3 and MS Windows
126 NT4 can function as a BDC to its own type of PDC.
127 </p><p>
128 The BDC is said to hold a <span class="emphasis"><em>read-only</em></span> of the SAM from which
129 it is able to process network logon requests and authenticate users. The BDC can
130 continue to provide this service, particularly while, for example, the wide area
131 network link to the PDC is down. A BDC plays a very important role in both the
132 maintenance of Domain Security as well as in network integrity.
133 </p><p>
134 In the event that the NT4 PDC should need to be taken out of service, or if it dies, 
135 one of the NT4 BDCs can be promoted to a PDC. If this happens while the original NT4 PDC is on
136 line, it is automatically demoted to an NT4 BDC. This is an important aspect of Domain
137 Controller management. The tool that is used to effect a promotion or a demotion is the
138 Server Manager for Domains. It should be noted that Samba-3 BDCs can not be promoted
139 in this manner because reconfiguration of Samba requires changes to the <tt class="filename">smb.conf</tt> file.
140 </p><div class="sect3" lang="en"><div class="titlepage"><div><div><h4 class="title"><a name="id2891756"></a>Example PDC Configuration</h4></div></div><div></div></div><p>
141 Beginning with Version 2.2, Samba officially supports domain logons for all current Windows clients,
142 including Windows NT4, 2003 and XP Professional. For Samba to be enabled as a PDC, some
143 parameters in the <i class="parameter"><tt>[global]</tt></i>-section of the <tt class="filename">smb.conf</tt> have to be set.
144 Refer to <link linkend="minimalPDC"> for an example of the minimum required settings.
145 </p><div class="example"><a name="minimalPDC"></a><p class="title"><b>Example 6.1. Minimal smb.conf for a PDC in Use With a BDC  LDAP Server on PDC.</b></p><table class="simplelist" border="0" summary="Simple list"><tr><td><i class="parameter"><tt>workgroup = MIDEARTH</tt></i></td></tr><tr><td><i class="parameter"><tt>passdb backend = ldapsam://localhost:389</tt></i></td></tr><tr><td><i class="parameter"><tt>domain master = yes</tt></i></td></tr><tr><td><i class="parameter"><tt>domain logons = yes</tt></i></td></tr></table></div><p>
146 Several other things like a <i class="parameter"><tt>[homes]</tt></i> and a
147 <i class="parameter"><tt>[netlogon]</tt></i> share also need to be set along with
148 settings for the profile path, the user's home drive, and so on. This is not covered in this
149 chapter; for more information please refer to <link linkend="samba-pdc">.
150 </p></div></div><div class="sect2" lang="en"><div class="titlepage"><div><div><h3 class="title"><a name="id2891874"></a>LDAP Configuration Notes</h3></div></div><div></div></div><p>
151 When configuring a master and a slave LDAP server, it is advisable to use the master LDAP server
152 for the PDC and slave LDAP servers for the BDCs. It is not essential to use slave LDAP servers, however,
153 many administrators will want to do so in order to provide redundant services. Of course, one or more BDCs
154 may use any slave LDAP server. Then again, it is entirely possible to use a single LDAP server for the
155 entire network.
156 </p><p>
157 When configuring a master LDAP server that will have slave LDAP servers, do not forget to configure
158 this in the <tt class="filename">/etc/openldap/slapd.conf</tt> file. It must be noted that the DN of a
159 server certificate must use the CN attribute to name the server, and the CN must carry the servers'
160 fully qualified domain name. Additional alias names and wildcards may be present in the
161 subjectAltName certificate extension. More details on server certificate names are in RFC2830.
162 </p><p>
163 It does not really fit within the scope of this document, but a working LDAP installation is
164 basic to LDAP enabled Samba operation. When using an OpenLdap server with Transport Layer Security
165 (TLS), the machine name in <tt class="filename">/etc/ssl/certs/slapd.pem</tt> must be the
166 same as in <tt class="filename">/etc/openldap/sldap.conf</tt>. The Red Hat Linux startup script
167 creates the <tt class="filename">slapd.pem</tt> file with hostname &#8220;<span class="quote">localhost.localdomain.</span>&#8221;
168 It is impossible to access this LDAP server from a slave LDAP server (i.e., a Samba BDC) unless the
169 certificate is recreated with a correct hostname.
170 </p><p>
171 Do not install a Samba PDC on a OpenLDAP slave server. Joining client machines to the domain
172 will fail in this configuration because the change to the machine account in the LDAP tree
173 must take place on the master LDAP server. This is not replicated rapidly enough to the slave
174 server that the PDC queries. It therfore gives an error message on the client machine about
175 not being able to set up account credentials. The machine account is created on the LDAP server
176 but the password fields will be empty.
177 </p><p>
178 Possible PDC/BDC plus LDAP configurations include:
179 </p><div class="itemizedlist"><ul type="disc"><li><p>
180         PDC+BDC -&gt; One Central LDAP Server.
181         </p></li><li><p>
182         PDC -&gt; LDAP master server, BDC -&gt; LDAP slave server.
183         </p></li><li><p>
184         PDC -&gt; LDAP master, with secondary slave LDAP server.
185         </p><p>
186         BDC -&gt; LDAP master, with secondary slave LDAP server.
187         </p></li><li><p>
188         PDC -&gt; LDAP master, with secondary slave LDAP server.
189         </p><p>
190         BDC -&gt; LDAP slave server, with secondary master LDAP server.
191         </p></li></ul></div><p>
192 In order to have a fall-back configuration (secondary) LDAP server one would specify
193 the secondary LDAP server in the <tt class="filename">smb.conf</tt> file as shown in <link linkend="mulitldapcfg">.
194 </p><p>
195 </p><div class="example"><a name="mulitldapcfg"></a><p class="title"><b>Example 6.2. Multiple LDAP Servers in smb.conf</b></p><table class="simplelist" border="0" summary="Simple list"><tr><td>...</td></tr><tr><td><i class="parameter"><tt>passdb backend = ldapsam:ldap://master.quenya.org</tt></i></td></tr><tr><td><i class="parameter"><tt>ldapsam:ldap://slave.quenya.org</tt></i></td></tr><tr><td>...</td></tr></table></div><p>
196 </p></div><div class="sect2" lang="en"><div class="titlepage"><div><div><h3 class="title"><a name="id2892094"></a>Active Directory Domain Control</h3></div></div><div></div></div><p>
197 As of the release of MS Windows 2000 and Active Directory, this information is now stored
198 in a directory that can be replicated and for which partial or full administrative control
199 can be delegated. Samba-3 is not able to be a Domain Controller within an Active Directory
200 tree, and it cannot be an Active Directory server. This means that Samba-3 also cannot
201 act as a Backup Domain Controller to an Active Directory Domain Controller.
202 </p></div><div class="sect2" lang="en"><div class="titlepage"><div><div><h3 class="title"><a name="id2892115"></a>What Qualifies a Domain Controller on the Network?</h3></div></div><div></div></div><p>
203 Every machine that is a Domain Controller for the domain MIDEARTH has to register the NetBIOS
204 group name MIDEARTH&lt;#1c&gt; with the WINS server and/or by broadcast on the local network.
205 The PDC also registers the unique NetBIOS name MIDEARTH&lt;#1b&gt; with the WINS server.
206 The name type &lt;#1b&gt; name is normally reserved for the Domain Master Browser, a role
207 that has nothing to do with anything related to authentication, but the Microsoft Domain
208 implementation requires the Domain Master Browser to be on the same machine as the PDC.
209 </p><p>
210 Where a WINS server is not used, broadcast name registrations alone must suffice. Refer to
211 <link linkend="netdiscuss"> for more information regarding TCP/IP network protocols and how
212  SMB/CIFS names are handled.
213 </p></div><div class="sect2" lang="en"><div class="titlepage"><div><div><h3 class="title"><a name="id2892157"></a>How does a Workstation find its Domain Controller?</h3></div></div><div></div></div><p>
214 There are two different mechanisms to locate a domain controller, one method is used when
215 NetBIOS over TCP/IP is enabled and the other when it has been disabled in the TCP/IP
216 network configuration.
217 </p><p>
218 Where NetBIOS over TCP/IP is disabled, all name resolution involves the use of DNS, broadcast
219 messaging over UDP, as well as Active Directory communication technologies. In this type of
220 environment all machines require appropriate DNS entries. More information may be found in
221 <link linkend="adsdnstech">.
222 </p><div class="sect3" lang="en"><div class="titlepage"><div><div><h4 class="title"><a name="id2892189"></a>NetBIOS Over TCP/IP Enabled</h4></div></div><div></div></div><p>
223 An MS Windows NT4/200x/XP Professional workstation in the domain MIDEARTH that wants a
224 local user to be authenticated has to find the Domain Controller for MIDEARTH. It does this
225 by doing a NetBIOS name query for the group name MIDEARTH&lt;#1c&gt;. It assumes that each
226 of the machines it gets back from the queries is a Domain Controller and can answer logon
227 requests. To not open security holes, both the workstation and the selected Domain Controller
228 authenticate each other. After that the workstation sends the user's credentials (name and
229 password) to the local Domain Controller for validation.
230 </p></div><div class="sect3" lang="en"><div class="titlepage"><div><div><h4 class="title"><a name="id2892201"></a>NetBIOS Over TCP/IP Disabled</h4></div></div><div></div></div><p>
231 An MS Windows NT4/200x/XP Professional workstation in the realm <tt class="constant">quenya.org</tt>
232 that has a need to affect user logon authentication will locate the Domain Controller by 
233 requerying DNS servers for the <tt class="constant">_ldap._tcp.pdc.ms-dcs.quenya.org</tt> record.
234 More information regarding this subject may be found in <link linkend="adsdnstech">.
235 </p></div></div></div><div class="sect1" lang="en"><div class="titlepage"><div><div><h2 class="title" style="clear: both"><a name="id2892268"></a>Backup Domain Controller Configuration</h2></div></div><div></div></div><p>
236 The creation of a BDC requires some steps to prepare the Samba server before
237 <span class="application">smbd</span> is executed for the first time. These steps are outlines as follows:
238 <a class="indexterm" name="id2892289"></a>
239 </p><div class="itemizedlist"><ul type="disc"><li><p>
240         The domain SID has to be the same on the PDC and the BDC. In Samba versions
241         pre-2.2.5, the domain SID was stored in the file <tt class="filename">private/MACHINE.SID</tt>.
242         The domain SID is now stored in the file <tt class="filename">private/secrets.tdb</tt>. This file
243         is unique to each server and can not be copied from a PDC to a BDC, the BDC will generate
244         a new SID at start-up. It will over-write the PDC domain SID with the newly created BDC SID.
245         There is a procedure that will allow the BDC to aquire the Domain SID. This is described here.
246         </p><p>
247         To retrieve the domain SID from the PDC or an existing BDC and store it in the
248         <tt class="filename">secrets.tdb</tt>, execute:
249         </p><pre class="screen">
250 <tt class="prompt">root# </tt><b class="userinput"><tt>net rpc getsid</tt></b>
251 </pre></li><li><p>
252         Specification of the <a class="indexterm" name="id2892368"></a><i class="parameter"><tt>ldap admin dn</tt></i> is obligatory.
253         This also requires the LDAP administration password to be set in the <tt class="filename">secrets.tdb</tt>
254         using the <b class="command">smbpasswd -w <i class="replaceable"><tt>mysecret</tt></i></b>.
255         </p></li><li><p>
256         Either <a class="indexterm" name="id2892405"></a><i class="parameter"><tt>ldap suffix</tt></i> or
257         <a class="indexterm" name="id2892419"></a><i class="parameter"><tt>ldap idmap suffix</tt></i> must be specified in
258         the <tt class="filename">smb.conf</tt> file.
259         </p></li><li><p>
260 <a class="indexterm" name="id2892446"></a>
261         The UNIX user database has to be synchronized from the PDC to the
262         BDC. This means that both the <tt class="filename">/etc/passwd</tt> and
263         <tt class="filename">/etc/group</tt> have to be replicated from the PDC
264         to the BDC. This can be done manually whenever changes are made. 
265         Alternately, the PDC is set up as an NIS master server and the BDC as an NIS slave
266         server. To set up the BDC as a mere NIS client would not be enough,
267         as the BDC would not be able to access its user database in case of
268         a PDC failure. NIS is by no means the only method to synchronize
269         passwords. An LDAP solution would also work.
270         </p></li><li><p>
271         The Samba password database must be replicated from the PDC to the BDC.
272         Although it is possible to synchronize the <tt class="filename">smbpasswd</tt>
273         file with <b class="command">rsync</b> and <b class="command">ssh</b>, this method
274         is broken and flawed, and is therefore not recommended. A better solution
275         is to set up slave LDAP servers for each BDC and a master LDAP server for the PDC.
276         </p></li><li><p>
277         The netlogon share has to be replicated from the PDC to the
278         BDC. This can be done manually whenever login scripts are changed,
279         or it can be done automatically using a <b class="command">cron</b> job
280         that will replicate the directory structure in this share using a tool
281         like <b class="command">rsync</b>.
282         </p></li></ul></div><div class="sect2" lang="en"><div class="titlepage"><div><div><h3 class="title"><a name="id2892538"></a>Example Configuration</h3></div></div><div></div></div><p>
283 Finally, the BDC has to be found by the workstations. This can be done by setting Samba as shown in <link linkend="minim-bdc">.
284 </p><div class="example"><a name="minim-bdc"></a><p class="title"><b>Example 6.3. Minimal setup for being a BDC</b></p><table class="simplelist" border="0" summary="Simple list"><tr><td><i class="parameter"><tt>workgroup = MIDEARTH</tt></i></td></tr><tr><td><i class="parameter"><tt>passdb backend = ldapsam:ldap://slave-ldap.quenya.org</tt></i></td></tr><tr><td><i class="parameter"><tt>domain master = no</tt></i></td></tr><tr><td><i class="parameter"><tt>domain logons = yes</tt></i></td></tr><tr><td><i class="parameter"><tt>idmap backend = ldapsam:ldap://slave-ldap.quenya.org</tt></i></td></tr></table></div><p>
285 In the <i class="parameter"><tt>[global]</tt></i>-section of the <tt class="filename">smb.conf</tt> of the BDC. This makes the BDC
286 only register the name SAMBA&lt;#1c&gt; with the WINS server. This is no
287 problem as the name SAMBA&lt;#1c&gt; is a NetBIOS group name that is meant to
288 be registered by more than one machine. The parameter
289 <a class="indexterm" name="id2892643"></a><i class="parameter"><tt>domain master</tt></i> = no
290 forces the BDC not to register SAMBA&lt;#1b&gt; which as a unique NetBIOS
291 name is reserved for the Primary Domain Controller.
292 </p><p>
293 <a class="indexterm" name="id2892668"></a>
294 <a class="indexterm" name="id2892677"></a>
295 The <i class="parameter"><tt>idmap backend</tt></i> will redirect the <b class="command">winbindd</b> utility to
296 use the LDAP database to resolve all UIDs and GIDs for UNIX accounts.
297 </p><div class="note" style="margin-left: 0.5in; margin-right: 0.5in;"><h3 class="title">Note</h3><p>
298 <a class="indexterm" name="id2892706"></a>
299 Samba-3 has introduced a new ID mapping facility. One of the features of this facility is that it
300 allows greater flexibility in how user and group IDs are handled in respect to NT Domain User and Group
301 SIDs. One of the new facilities provides for explicitly ensuring that UNIX/Linux UID and GID values
302 will be consistent on the PDC, all BDCs and all Domain Member servers. The parameter that controls this
303 is called <i class="parameter"><tt>idmap backend</tt></i>. Please refer to the man page for <tt class="filename">smb.conf</tt> for more information
304 regarding its behavior.
305 </p></div><p>
306 The use of the <a class="indexterm" name="id2892744"></a><i class="parameter"><tt>idmap backend</tt></i> = ldap://master.quenya/org
307 option on a BDC only make sense where ldapsam is used on a PDC. The purpose for an LDAP based idmap backend is
308 also to allow a domain-member (without its own passdb backend) to use winbindd to resolve Windows network users
309 and groups to common UID/GIDs. In other words, this option is generally intended for use on BDCs and on Domain
310 Member servers.
311 </p></div></div><div class="sect1" lang="en"><div class="titlepage"><div><div><h2 class="title" style="clear: both"><a name="id2892768"></a>Common Errors</h2></div></div><div></div></div><p>
312 As this is a rather new area for Samba, there are not many examples that we may refer to.
313 Updates will be published as they become available and may be found in later Samba releases or
314 from the Samba web <ulink url="http://samba.org">site.</ulink>
315 </p><div class="sect2" lang="en"><div class="titlepage"><div><div><h3 class="title"><a name="id2892791"></a>Machine Accounts Keep Expiring</h3></div></div><div></div></div><p>
316 <a class="indexterm" name="id2892802"></a>
317 This problem will occur when the passdb (SAM) files are copied  from a central
318 server but the local Backup Domain Controller is acting as a PDC. This results in the application of
319 Local Machine Trust Account password updates to the local SAM. Such updates 
320 are not copied back to the central server. The newer machine account password is then over
321 written when the SAM is re-copied from the PDC. The result is that the Domain Member machine
322 on start up will find that its passwords do not match the one now in the database and
323 since the startup security check will now fail, this machine will not allow logon attempts
324 to proceed and the account expiry error will be reported.
325 </p><p>
326 The solution is to use a more robust passdb backend, such as the ldapsam backend, setting up
327 a slave LDAP server for each BDC, and a master LDAP server for the PDC.
328 </p></div><div class="sect2" lang="en"><div class="titlepage"><div><div><h3 class="title"><a name="id2892845"></a>Can Samba Be a Backup Domain Controller to an NT4 PDC?</h3></div></div><div></div></div><p>
329 <a class="indexterm" name="id2892857"></a>
330 No. The native NT4 SAM replication protocols have not yet been fully implemented.
331 </p><p>
332 Can I get the benefits of a BDC with Samba?  Yes, but only to a Samba PDC.The
333 main reason for implementing a BDC is availability. If the PDC is a Samba
334 machine, a second Samba machine can be set up to service logon requests whenever
335 the PDC is down.
336 </p></div><div class="sect2" lang="en"><div class="titlepage"><div><div><h3 class="title"><a name="id2892880"></a>How Do I Replicate the smbpasswd File?</h3></div></div><div></div></div><p>
337 <a class="indexterm" name="id2892891"></a>
338 Replication of the smbpasswd file is sensitive. It has to be done whenever changes
339 to the SAM are made. Every user's password change is done in the smbpasswd file and
340 has to be replicated to the BDC. So replicating the smbpasswd file very often is necessary.
341 </p><p>
342 As the smbpasswd file contains plain text password equivalents, it must not be
343 sent unencrypted over the wire. The best way to set up smbpasswd replication from
344 the PDC to the BDC is to use the utility rsync. rsync can use ssh as a transport.
345 <b class="command">ssh</b> itself can be set up to accept <span class="emphasis"><em>only</em></span>
346 <b class="command">rsync</b> transfer without requiring the user to type a password.
347 </p><p>
348 As said a few times before, use of this method is broken and flawed. Machine trust 
349 accounts will go out of sync, resulting in a broken domain. This method is
350 <span class="emphasis"><em>not</em></span> recommended. Try using LDAP instead.
351 </p></div><div class="sect2" lang="en"><div class="titlepage"><div><div><h3 class="title"><a name="id2892948"></a>Can I Do This All with LDAP?</h3></div></div><div></div></div><p>
352 The simple answer is yes. Samba's pdb_ldap code supports binding to a replica
353 LDAP server, and will also follow referrals and rebind to the master if it ever
354 needs to make a modification to the database. (Normally BDCs are read only, so
355 this will not occur often).
356 </p></div></div></div><div class="navfooter"><hr><table width="100%" summary="Navigation footer"><tr><td width="40%" align="left"><a accesskey="p" href="samba-pdc.html">Prev</a> </td><td width="20%" align="center"><a accesskey="u" href="type.html">Up</a></td><td width="40%" align="right"> <a accesskey="n" href="domain-member.html">Next</a></td></tr><tr><td width="40%" align="left" valign="top">Chapter 5. Domain Control </td><td width="20%" align="center"><a accesskey="h" href="index.html">Home</a></td><td width="40%" align="right" valign="top"> Chapter 7. Domain Membership</td></tr></table></div></body></html>