1 <chapter id="samba-bdc">
8 <title>Backup Domain Control</title>
11 Before you continue reading in this section, please make sure that you are comfortable
12 with configuring a Samba Domain Controller as described in the
13 <ulink url="Samba-PDC-HOWTO.html">Domain Control Chapter</ulink>.
17 <title>Features And Benefits</title>
26 <title>Essential Background Information</title>
29 A Domain Controller is a machine that is able to answer logon requests from network
30 workstations. Microsoft LanManager and IBM LanServer were two early products that
31 provided this capability. The technology has become known as the LanMan Netlogon service.
35 When MS Windows NT3.10 was first released it supported an new style of Domain Control
36 and with it a new form of the network logon service that has extended functionality.
37 This service became known as the NT NetLogon Service. The nature of this service has
38 changed with the evolution of MS Windows NT and today provides a very complex array of
39 services that are implemented over a complex spectrum of technologies.
43 <title>MS Windows NT4 Style Domain Control</title>
46 Whenever a user logs into a Windows NT4 / 200x / XP Profresional Workstation,
47 the workstation connects to a Domain Controller (authentication server) to validate
48 the username and password that the user entered are valid. If the information entered
49 does not validate against the account information that has been stored in the Domain
50 Control database (the SAM, or Security Accounts Manager database) then a set of error
51 codes is returned to the workstation that has made the authentication request.
55 When the username / password pair has been validated, the Domain Controller
56 (authentication server) will respond with full enumeration of the account information
57 that has been stored regarding that user in the User and Machine Accounts database
58 for that Domain. This information contains a complete network access profile for
59 the user but excludes any information that is particular to the user's desktop profile,
60 or for that matter it excludes all desktop profiles for groups that the user may
61 belong to. It does include password time limits, password uniqueness controls,
62 network access time limits, account validity information, machine names from which the
63 user may access the network, and much more. All this information was stored in the SAM
64 in all versions of MS Windows NT (3.10, 3.50, 3.51, 4.0).
67 The account information (user and machine) on Domain Controllers is stored in two files,
68 one containing the Security information and the other the SAM. These are stored in files
69 by the same name in the <filename>C:\WinNT\System32\config</filename> directory. These
70 are the files that are involved in replication of the SAM database where Backup Domain
71 Controllers are present on the network.
75 There are two situations in which it is desirable to install Backup Domain Controllers:
80 On the local network that the Primary Domain Controller is on if there are many
81 workstations and/or where the PDC is generally very busy. In this case the BDCs
82 will pick up network logon requests and help to add robustness to network services.
86 At each remote site, to reduce wide area network traffic and to add stability to
87 remote network operations. The design of the network, the strategic placement of
88 Backup Domain Controllers, together with an implementation that localises as much
89 of network to client interchange as possible will help to minimise wide area network
90 bandwidth needs (and thus costs).
95 The PDC contains the master copy of the SAM. In the event that an administrator makes a
96 change to the user account database while physically present on the local network that
97 has the PDC, the change will likely be made directly to the PDC instance of the master
98 copy of the SAM. In the event that this update may be performed in a branch office the
99 change will likely be stored in a delta file on the local BDC. The BDC will then send
100 a trigger to the PDC to commence the process of SAM synchronisation. The PDC will then
101 request the delta from the BDC and apply it to the master SAM. THe PDC will then contact
102 all the BDCs in the Domain and trigger them to obtain the update and then apply that to
103 their own copy of the SAM.
107 Thus the BDC is said to hold a <emphasis>read-only</emphasis> of the SAM from which
108 it is able to process network logon requests and to authenticate users. The BDC can
109 continue to provide this service, particularly while, for example, the wide area
110 network link to the PDC is down. Thus a BDC plays a very important role in both
111 maintenance of Domain security as well as in network integrity.
115 In the event that the PDC should need to be taken out of service, or if it dies, then
116 one of the BDCs can be promoted to a PDC. If this happens while the original PDC is on
117 line then it is automatically demoted to a BDC. This is an important aspect of Domain
118 Controller management. The tool that is used to affect a promotion or a demotion is the
119 Server Manager for Domains.
123 <title>Example PDC Configuration</title>
126 Since version 2.2 Samba officially supports domain logons for all current Windows Clients,
127 including Windows NT4, 2003 and XP Professional. For samba to be enabled as a PDC some
128 parameters in the [global]-section of the smb.conf have to be set:
131 <para><programlisting>
135 </programlisting></para>
138 Several other things like a [homes] and a [netlogon] share also need to be set along with
139 settings for the profile path, the users home drive, etc.. This will not be covered in this
140 chapter, for more information please refer to the chapter on Domain Control.
147 <title>Active Directory Domain Control</title>
150 As of the release of MS Windows 2000 and Active Directory, this information is now stored
151 in a directory that can be replicated and for which partial or full administrative control
152 can be delegated. Samba-3 is NOT able to be a Domain Controller within an Active Directory
153 tree, and it can not be an Active Directory server. This means that Samba-3 also can NOT
154 act as a Backup Domain Contoller to an Active Directory Domain Controller.
160 <title>What qualifies a Domain Controller on the network?</title>
163 Every machine that is a Domain Controller for the domain SAMBA has to register the NetBIOS
164 group name SAMBA<#1c> with the WINS server and/or by broadcast on the local network.
165 The PDC also registers the unique NetBIOS name SAMBA<#1b> with the WINS server.
166 The name type <#1b> name is normally reserved for the Domain Master Browser, a role
167 that has nothing to do with anything related to authentication, but the Microsoft Domain
168 implementation requires the domain master browser to be on the same machine as the PDC.
174 <title>How does a Workstation find its domain controller?</title>
177 An MS Windows NT4 / 200x / XP Professional workstation in the domain SAMBA that wants a
178 local user to be authenticated has to find the domain controller for SAMBA. It does this
179 by doing a NetBIOS name query for the group name SAMBA<#1c>. It assumes that each
180 of the machines it gets back from the queries is a domain controller and can answer logon
181 requests. To not open security holes both the workstation and the selected domain controller
182 authenticate each other. After that the workstation sends the user's credentials (name and
183 password) to the local Domain Controller, for valdation.
190 <title>When is the PDC needed?</title>
193 Whenever a user wants to change his password, this has to be done on the PDC. To find
194 the PDC, the workstation does a NetBIOS name query for SAMBA<#1b>, assuming this
195 machine maintains the master copy of the SAM. The workstation contacts the PDC, both
196 mutually authenticate and the password change is done.
205 <title>Can Samba be a Backup Domain Controller to an NT4 PDC?</title>
208 With version 2.2, no. The native NT4 SAM replication protocols have not yet been fully
209 implemented. The Samba Team is working on understanding and implementing the protocols,
210 but this work has not been finished for version 2.2.
214 With version 3.0, the work on both the replication protocols and a suitable storage
215 mechanism has progressed, and some form of NT4 BDC support is expected soon.
219 Can I get the benefits of a BDC with Samba? Yes. The main reason for implementing a
220 BDC is availability. If the PDC is a Samba machine, a second Samba machine can be set up to
221 service logon requests whenever the PDC is down.
228 <title>Backup Domain Controller Configuration</title>
231 Several things have to be done:
236 The domain SID has to be the same on the PDC and the BDC. This used to
237 be stored in the file private/MACHINE.SID. This file is not created
238 anymore since Samba 2.2.5 or even earlier. Nowadays the domain SID is
239 stored in the file private/secrets.tdb. Simply copying the secrets.tdb
240 from the PDC to the BDC does not work, as the BDC would
241 generate a new SID for itself and override the domain SID with this
245 To retrieve the domain SID from the PDC or an existing BDC and store it in the
246 secrets.tdb, execute 'net rpc getsid' on the BDC.
250 The Unix user database has to be synchronized from the PDC to the
251 BDC. This means that both the /etc/passwd and /etc/group have to be
252 replicated from the PDC to the BDC. This can be done manually
253 whenever changes are made, or the PDC is set up as a NIS master
254 server and the BDC as a NIS slave server. To set up the BDC as a
255 mere NIS client would not be enough, as the BDC would not be able to
256 access its user database in case of a PDC failure.
261 The Samba password database in the file private/smbpasswd has to be
262 replicated from the PDC to the BDC. This is a bit tricky, see the
267 Any netlogon share has to be replicated from the PDC to the
268 BDC. This can be done manually whenever login scripts are changed,
269 or it can be done automatically together with the smbpasswd
276 Finally, the BDC has to be found by the workstations. This can be done by setting:
279 <para><programlisting>
283 </programlisting></para>
286 in the [global]-section of the smb.conf of the BDC. This makes the BDC
287 only register the name SAMBA#1c with the WINS server. This is no
288 problem as the name SAMBA#1c is a NetBIOS group name that is meant to
289 be registered by more than one machine. The parameter 'domain master =
290 no' forces the BDC not to register SAMBA#1b which as a unique NetBIOS
291 name is reserved for the Primary Domain Controller.
295 <title>How do I replicate the smbpasswd file?</title>
298 Replication of the smbpasswd file is sensitive. It has to be done whenever changes
299 to the SAM are made. Every user's password change is done in the smbpasswd file and
300 has to be replicated to the BDC. So replicating the smbpasswd file very often is necessary.
304 As the smbpasswd file contains plain text password equivalents, it must not be
305 sent unencrypted over the wire. The best way to set up smbpasswd replication from
306 the PDC to the BDC is to use the utility rsync. rsync can use ssh as a transport.
307 Ssh itself can be set up to accept *only* rsync transfer without requiring the user
315 <title>Can I do this all with LDAP?</title>
318 The simple answer is YES. Samba's pdb_ldap code supports binding to a replica
319 LDAP server, and will also follow referrals and rebind to the master if it ever
320 needs to make a modification to the database. (Normally BDCs are read only, so
321 this will not occur often).
328 <title>Common Errors</title>