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

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

Samba Server: update vendor to version 4.4.3

File size: 34.1 KB
Line 
1<?xml version="1.0" encoding="iso-8859-1"?>
2<!DOCTYPE chapter PUBLIC "-//Samba-Team//DTD DocBook V4.2-Based Variant V1.0//EN" "http://www.samba.org/samba/DTD/samba-doc">
3<chapter id="samba-bdc">
4
5<chapterinfo>
6 &author.jht;
7 &author.vl;
8 <author>&person.gd;<contrib>LDAP updates</contrib></author>
9</chapterinfo>
10
11<title>Backup Domain Control</title>
12
13<para>
14Before you continue reading this section, please make sure that you are comfortable
15with configuring a Samba domain controller as described in <link linkend="samba-pdc">Domain Control</link>.
16</para>
17
18<sect1>
19<title>Features and Benefits</title>
20
21<para>
22This is one of the most difficult chapters to summarize. It does not matter what we say here, for someone will
23still draw conclusions and/or approach the Samba Team with expectations that are either not yet capable of
24being delivered or that can be achieved far more effectively using a totally different approach. In the event
25that you should have a persistent concern that is not addressed in this book, please email <ulink
26url="mailto:jht@samba.org">John H. Terpstra</ulink> clearly setting out your requirements and/or question, and
27we will do our best to provide a solution.
28</para>
29
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>
36Samba can act as a Backup Domain Controller (BDC) to another Samba Primary Domain Controller (PDC). A
37Samba PDC can operate with an LDAP account backend. The LDAP backend can be either a common master LDAP
38server or a slave server. The use of a slave LDAP server has the benefit that when the master is down, clients
39may still be able to log onto the network. This effectively gives Samba a high degree of scalability and is
40an effective solution for large organizations. If you use an LDAP slave server for a PDC, you will need to
41ensure the master's continued availability &smbmdash; if the slave finds its master down at the wrong time,
42you will have stability and operational problems.
43</para>
44
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<indexterm><primary>propagate</primary></indexterm>
50It is not possible to run a Samba BDC with a non-LDAP backend, as that backend must allow some form of
51"two-way" propagation of changes from the BDC to the master. At this time only LDAP delivers the capability
52to propagate identity database changes from the BDC to the PDC. The BDC can use a slave LDAP server, while it
53is preferable for the PDC to use as its primary an LDAP master server.
54</para>
55
56</sect1>
57
58<sect1>
59<title>Essential Background Information</title>
60
61<para>
62<indexterm><primary>domain controller</primary></indexterm>
63<indexterm><primary>logon requests</primary></indexterm>
64<indexterm><primary>LanMan</primary></indexterm>
65<indexterm><primary>Netlogon</primary></indexterm>
66A domain controller is a machine that is able to answer logon requests from network
67workstations. Microsoft LanManager and IBM LanServer were two early products that
68provided this capability. The technology has become known as the LanMan Netlogon service.
69</para>
70
71<para>
72<indexterm><primary>network</primary><secondary>logon</secondary><tertiary>service</tertiary></indexterm>
73<indexterm><primary>Windows NT3.10</primary></indexterm>
74When MS Windows NT3.10 was first released, it supported a new style of Domain Control
75and with it a new form of the network logon service that has extended functionality.
76This service became known as the NT NetLogon Service. The nature of this service has
77changed with the evolution of MS Windows NT and today provides a complex array of
78services that are implemented over an intricate spectrum of technologies.
79</para>
80
81<sect2>
82<title>MS Windows NT4-style Domain Control</title>
83
84<para>
85<indexterm><primary>domain controller</primary></indexterm>
86<indexterm><primary>authentication server</primary></indexterm>
87<indexterm><primary>username</primary></indexterm>
88<indexterm><primary>password</primary></indexterm>
89<indexterm><primary>SAM</primary></indexterm>
90<indexterm><primary>Security Account Manager</primary><see>SAM</see></indexterm>
91<indexterm><primary>domain control database</primary><see>SAM</see></indexterm>
92Whenever a user logs into a Windows NT4/200x/XP Professional workstation,
93the workstation connects to a domain controller (authentication server) to validate that
94the username and password the user entered are valid. If the information entered
95does not match account information that has been stored in the domain
96control database (the SAM, or Security Account Manager database), a set of error
97codes is returned to the workstation that has made the authentication request.
98</para>
99
100<para>
101<indexterm><primary>account information</primary></indexterm>
102<indexterm><primary>machine accounts database</primary></indexterm>
103<indexterm><primary>profile</primary></indexterm>
104<indexterm><primary>network access profile</primary></indexterm>
105<indexterm><primary>desktop profile</primary></indexterm>
106When the username/password pair has been validated, the domain controller
107(authentication server) will respond with full enumeration of the account information
108that has been stored regarding that user in the user and machine accounts database
109for that domain. This information contains a complete network access profile for
110the user but excludes any information that is particular to the user's desktop profile,
111or for that matter it excludes all desktop profiles for groups that the user may
112belong to. It does include password time limits, password uniqueness controls,
113network access time limits, account validity information, machine names from which the
114user may access the network, and much more. All this information was stored in the SAM
115in all versions of MS Windows NT (3.10, 3.50, 3.51, 4.0).
116</para>
117
118<para>
119<indexterm><primary>replication</primary><secondary>SAM</secondary></indexterm>
120<indexterm><primary>%SystemRoot%\System32\config</primary></indexterm>
121<indexterm><primary>C:\WinNT\System32\config</primary></indexterm>
122<indexterm><primary>BDC</primary></indexterm>
123<indexterm><primary>SAM</primary></indexterm>
124The account information (user and machine) on domain controllers is stored in two files,
125one containing the security information and the other the SAM. These are stored in files
126by the same name in the <filename>%SystemRoot%\System32\config</filename> directory.
127This normally translates to the path <filename>C:\WinNT\System32\config</filename>. These
128are the files that are involved in replication of the SAM database where BDCs are present
129on the network.
130</para>
131
132<para>
133There are two situations in which it is desirable to install BDCs:
134</para>
135
136<itemizedlist>
137 <listitem><para>
138 <indexterm><primary>PDC</primary></indexterm>
139 <indexterm><primary>BDC</primary></indexterm>
140 On the local network that the PDC is on, if there are many
141 workstations and/or where the PDC is generally very busy. In this case the BDCs
142 will pick up network logon requests and help to add robustness to network services.
143 </para></listitem>
144
145 <listitem><para>
146 <indexterm><primary>network</primary><secondary>wide-area</secondary></indexterm>
147 At each remote site, to reduce wide-area network traffic and to add stability to
148 remote network operations. The design of the network, and the strategic placement of
149 BDCs, together with an implementation that localizes as much of network to client
150 interchange as possible, will help to minimize wide-area network bandwidth needs
151 (and thus costs).
152 </para></listitem>
153</itemizedlist>
154
155<para>
156<indexterm><primary>PDC</primary></indexterm>
157<indexterm><primary>SAM</primary></indexterm>
158<indexterm><primary>user account database</primary></indexterm>
159<indexterm><primary>BDC</primary></indexterm>
160<indexterm><primary>trigger</primary></indexterm>
161The interoperation of a PDC and its BDCs in a true Windows NT4 environment is worth
162mentioning here. The PDC contains the master copy of the SAM. In the event that an
163administrator makes a change to the user account database while physically present
164on the local network that has the PDC, the change will likely be made directly to
165the PDC instance of the master copy of the SAM. In the event that this update may
166be performed in a branch office, the change will likely be stored in a delta file
167on the local BDC. The BDC will then send a trigger to the PDC to commence the process
168of SAM synchronization. The PDC will then request the delta from the BDC and apply
169it to the master SAM. The PDC will then contact all the BDCs in the domain and
170trigger them to obtain the update and then apply that to their own copy of the SAM.
171</para>
172
173<para>
174<indexterm><primary>SAM</primary><secondary>replication</secondary></indexterm>
175<indexterm><primary>SAM</primary><secondary>delta file</secondary></indexterm>
176<indexterm><primary>PDC</primary></indexterm>
177<indexterm><primary>BDC</primary></indexterm>
178Samba cannot participate in true SAM replication and is therefore not able to
179employ precisely the same protocols used by MS Windows NT4. A Samba BDC will
180not create SAM update delta files. It will not interoperate with a PDC (NT4 or Samba)
181to synchronize the SAM from delta files that are held by BDCs.
182</para>
183
184<para>
185<indexterm><primary>PDC</primary></indexterm>
186<indexterm><primary>BDC</primary></indexterm>
187Samba cannot function as a BDC to an MS Windows NT4 PDC, and Samba-3 cannot
188function correctly as a PDC to an MS Windows NT4 BDC. Both Samba and MS Windows
189NT4 can function as a BDC to its own type of PDC.
190</para>
191
192<para>
193<indexterm><primary>SAM</primary></indexterm>
194<indexterm><primary>BDC</primary></indexterm>
195<indexterm><primary>domain security</primary></indexterm>
196The BDC is said to hold a <emphasis>read-only</emphasis> of the SAM from which
197it is able to process network logon requests and authenticate users. The BDC can
198continue to provide this service, particularly while, for example, the wide-area
199network link to the PDC is down. A BDC plays a very important role in both the
200maintenance of domain security as well as in network integrity.
201</para>
202
203<para>
204<indexterm><primary>PDC</primary></indexterm>
205<indexterm><primary>promoted</primary></indexterm>
206<indexterm><primary>demoted</primary></indexterm>
207<indexterm><primary>reconfiguration</primary></indexterm>
208In the event that the NT4 PDC should need to be taken out of service, or if it dies, one of the NT4 BDCs can
209be promoted to a PDC. If this happens while the original NT4 PDC is online, it is automatically demoted to an
210NT4 BDC. This is an important aspect of domain controller management. The tool that is used to effect a
211promotion or a demotion is the Server Manager for Domains. It should be noted that Samba BDCs cannot be
212promoted in this manner because reconfiguration of Samba requires changes to the &smb.conf; file. It is easy
213enough to manuall change the &smb.conf; file and then restart relevant Samba network services.
214</para>
215
216<sect3>
217<title>Example PDC Configuration</title>
218
219<para>
220<indexterm><primary>domain logon</primary></indexterm>
221<indexterm><primary>PDC</primary></indexterm>
222Beginning with Version 2.2, Samba officially supports domain logons for all current Windows clients, including
223Windows NT4, 2003, and XP Professional. For Samba to be enabled as a PDC, some parameters in the
224<smbconfsection name="[global]"/> section of the &smb.conf; have to be set. Refer to <link
225linkend="minimalPDC">the Minimal smb.conf for a PDC in Use with a BDC &smbmdash; LDAP Server on PDC
226section</link> for an example of the minimum required settings.
227</para>
228
229<example id="minimalPDC">
230<title>Minimal smb.conf for a PDC in Use with a BDC &smbmdash; LDAP Server on PDC</title>
231<smbconfblock>
232<smbconfoption name="workgroup">&example.workgroup;</smbconfoption>
233<smbconfoption name="passdb backend">ldapsam://localhost:389</smbconfoption>
234<smbconfoption name="domain master">yes</smbconfoption>
235<smbconfoption name="domain logons">yes</smbconfoption>
236<smbconfoption name="ldap suffix">dc=quenya,dc=org</smbconfoption>
237<smbconfoption name="ldap user suffix">ou=Users</smbconfoption>
238<smbconfoption name="ldap group suffix">ou=Groups</smbconfoption>
239<smbconfoption name="ldap machine suffix">ou=Computers</smbconfoption>
240<smbconfoption name="ldap idmap suffix">ou=Idmap</smbconfoption>
241<smbconfoption name="ldap admin dn">cn=sambadmin,dc=quenya,dc=org</smbconfoption>
242</smbconfblock>
243</example>
244
245<para>
246<indexterm><primary>profile path</primary></indexterm>
247<indexterm><primary>home drive</primary></indexterm>
248Several other things like a <smbconfsection name="[homes]"/> and a <smbconfsection name="[netlogon]"/> share
249also need to be set along with settings for the profile path, the user's home drive, and so on. This is not
250covered in this chapter; for more information please refer to <link linkend="samba-pdc">Domain Control</link>.
251Refer to <link linkend="samba-pdc">the Domain Control chapter</link> for specific recommendations for PDC
252configuration. Alternately, fully documented working example network configurations using OpenLDAP and Samba
253as available in the <ulink url="http://www.samba.org/samba/docs/Samba3-ByExample">book</ulink> <quote>Samba-3
254by Example</quote> that may be obtained from local and on-line book stores.
255</para>
256
257</sect3>
258</sect2>
259
260<sect2>
261<title>LDAP Configuration Notes</title>
262
263<para>
264<indexterm><primary>LDAP</primary><secondary>master</secondary></indexterm>
265<indexterm><primary>LDAP</primary><secondary>slave</secondary></indexterm>
266<indexterm><primary>BDC</primary></indexterm>
267When configuring a master and a slave LDAP server, it is advisable to use the master LDAP server
268for the PDC and slave LDAP servers for the BDCs. It is not essential to use slave LDAP servers; however,
269many administrators will want to do so in order to provide redundant services. Of course, one or more BDCs
270may use any slave LDAP server. Then again, it is entirely possible to use a single LDAP server for the
271entire network.
272</para>
273
274<para>
275<indexterm><primary>LDAP</primary><secondary>master</secondary></indexterm>
276<indexterm><primary>LDAP</primary><secondary>server</secondary></indexterm>
277<indexterm><primary>CN</primary></indexterm>
278<indexterm><primary>DN</primary></indexterm>
279<indexterm><primary>RFC2830</primary></indexterm>
280When configuring a master LDAP server that will have slave LDAP servers, do not forget to configure this in
281the <filename>/etc/openldap/slapd.conf</filename> file. It must be noted that the DN of a server certificate
282must use the CN attribute to name the server, and the CN must carry the servers' fully qualified domain name.
283Additional alias names and wildcards may be present in the subjectAltName certificate extension. More details
284on server certificate names are in RFC2830.
285</para>
286
287<para>
288<indexterm><primary>LDAP</primary></indexterm>
289<indexterm><primary>BDC</primary></indexterm>
290<indexterm><primary>OpenLDAP</primary></indexterm>
291<indexterm><primary>transport layer security</primary><see>TLS</see></indexterm>
292<indexterm><primary>/etc/ssl/certs/slapd.pem</primary></indexterm>
293<indexterm><primary>slapd.pem</primary></indexterm>
294<indexterm><primary>Red Hat Linux</primary></indexterm>
295It does not really fit within the scope of this document, but a working LDAP installation is basic to
296LDAP-enabled Samba operation. When using an OpenLDAP server with Transport Layer Security (TLS), the machine
297name in <filename>/etc/ssl/certs/slapd.pem</filename> must be the same as in
298<filename>/etc/openldap/sldap.conf</filename>. The Red Hat Linux startup script creates the
299<filename>slapd.pem</filename> file with hostname <quote>localhost.localdomain.</quote> It is impossible to
300access this LDAP server from a slave LDAP server (i.e., a Samba BDC) unless the certificate is re-created with
301a correct hostname.
302</para>
303
304<para>
305<indexterm><primary>PDC</primary></indexterm>
306<indexterm><primary>OpenLDAP</primary></indexterm>
307<indexterm><primary>machine account</primary></indexterm>
308<indexterm><primary>credentials</primary></indexterm>
309<indexterm><primary>replication</primary></indexterm>
310<indexterm><primary>duplicate</primary></indexterm>
311Do not install a Samba PDC so that is uses an LDAP slave server. Joining client machines to the domain
312will fail in this configuration because the change to the machine account in the LDAP tree must take place on
313the master LDAP server. This is not replicated rapidly enough to the slave server that the PDC queries. It
314therefore gives an error message on the client machine about not being able to set up account credentials. The
315machine account is created on the LDAP server, but the password fields will be empty. Unfortunately, some
316sites are unable to avoid such configurations, and these sites should review the <smbconfoption name="ldap
317replication sleep"/> parameter, intended to slow down Samba sufficiently for the replication to catch up.
318This is a kludge, and one that the administrator must manually duplicate in any scripts (such as the
319<smbconfoption name="add machine script"/>) that they use.
320</para>
321
322<para>
323Possible PDC/BDC plus LDAP configurations include:
324</para>
325
326<itemizedlist>
327 <listitem><para>
328 PDC+BDC -> One Central LDAP Server.
329 </para></listitem>
330 <listitem><para>
331 PDC -> LDAP master server, BDC -> LDAP slave server.
332 </para></listitem>
333 <listitem><para>
334 PDC -> LDAP master, with secondary slave LDAP server.
335 </para><para>
336 BDC -> LDAP master, with secondary slave LDAP server.
337 </para></listitem>
338 <listitem><para>
339 PDC -> LDAP master, with secondary slave LDAP server.
340 </para><para>
341 BDC -> LDAP slave server, with secondary master LDAP server.
342 </para></listitem>
343</itemizedlist>
344
345<para>
346In order to have a fallback configuration (secondary) LDAP server, you would specify
347the secondary LDAP server in the &smb.conf; file as shown in <link linkend="mulitldapcfg">the Multiple LDAP
348Servers in &smb.conf; example</link>.
349</para>
350
351<example id="mulitldapcfg">
352<title>Multiple LDAP Servers in &smb.conf;</title>
353<smbconfblock>
354<smbconfoption name="passdb backend">ldapsam:"ldap://master.quenya.org ldap://slave.quenya.org"</smbconfoption>
355</smbconfblock>
356</example>
357
358</sect2>
359
360<sect2>
361<title>Active Directory Domain Control</title>
362
363<para>
364<indexterm><primary>MS Windows 2000</primary></indexterm>
365<indexterm><primary>Active Directory</primary></indexterm>
366<indexterm><primary>directory</primary></indexterm>
367<indexterm><primary>replicated</primary></indexterm>
368<indexterm><primary>BDC</primary></indexterm>
369<indexterm><primary>domain controller</primary></indexterm>
370As of the release of MS Windows 2000 and Active Directory, this information is now stored
371in a directory that can be replicated and for which partial or full administrative control
372can be delegated. Samba-4.0 is able to be a domain controller within an Active Directory
373tree, and it can be an Active Directory server. The details for how
374this can be done are documented in the <ulink
375url="https://wiki.samba.org/index.php/Samba4/HOWTO">Samba 4.0 as an
376AD DC HOWTO</ulink>
377
378</para>
379
380</sect2>
381
382<sect2>
383<title>What Qualifies a Domain Controller on the Network?</title>
384
385<para>
386<indexterm><primary>DMB</primary></indexterm>
387<indexterm><primary>PDC</primary></indexterm>
388<indexterm><primary>WINS</primary></indexterm>
389<indexterm><primary>NetBIOS</primary></indexterm>
390Every machine that is a domain controller for the domain MIDEARTH has to register the NetBIOS
391group name MIDEARTH&lt;1C&gt; with the WINS server and/or by broadcast on the local network.
392The PDC also registers the unique NetBIOS name MIDEARTH&lt;1B&gt; with the WINS server.
393The name type &lt;1B&gt; name is normally reserved for the Domain Master Browser (DMB), a role
394that has nothing to do with anything related to authentication, but the Microsoft domain
395implementation requires the DMB to be on the same machine as the PDC.
396</para>
397
398<para>
399<indexterm><primary>broadcast</primary></indexterm>
400<indexterm><primary>name registration</primary></indexterm>
401<indexterm><primary>SMB/CIFS</primary></indexterm>
402Where a WINS server is not used, broadcast name registrations alone must suffice. Refer to
403<link linkend="NetworkBrowsing">Network Browsing</link>,<link linkend="netdiscuss">Discussion</link>
404for more information regarding TCP/IP network protocols and how SMB/CIFS names are handled.
405</para>
406
407</sect2>
408
409<sect2>
410<title>How Does a Workstation find its Domain Controller?</title>
411
412<para>
413<indexterm><primary>locate domain controller</primary></indexterm>
414<indexterm><primary>NetBIOS</primary></indexterm>
415There are two different mechanisms to locate a domain controller: one method is used when
416NetBIOS over TCP/IP is enabled and the other when it has been disabled in the TCP/IP
417network configuration.
418</para>
419
420<para>
421<indexterm><primary>DNS</primary></indexterm>
422<indexterm><primary>broadcast messaging</primary></indexterm>
423Where NetBIOS over TCP/IP is disabled, all name resolution involves the use of DNS, broadcast
424messaging over UDP, as well as Active Directory communication technologies. In this type of
425environment all machines require appropriate DNS entries. More information may be found in
426<link linkend="adsdnstech">DNS and Active Directory</link>.
427</para>
428
429<sect3>
430<title>NetBIOS Over TCP/IP Enabled</title>
431<para>
432<indexterm><primary>Windows NT4/200x/XP</primary></indexterm>
433<indexterm><primary>domain controller</primary></indexterm>
434<indexterm><primary>logon requests</primary></indexterm>
435<indexterm><primary>credentials validation</primary></indexterm>
436An MS Windows NT4/200x/XP Professional workstation in the domain MIDEARTH that wants a
437local user to be authenticated has to find the domain controller for MIDEARTH. It does this
438by doing a NetBIOS name query for the group name MIDEARTH&lt;1C&gt;. It assumes that each
439of the machines it gets back from the queries is a domain controller and can answer logon
440requests. To not open security holes, both the workstation and the selected domain controller
441authenticate each other. After that the workstation sends the user's credentials (name and
442password) to the local domain controller for validation.
443</para>
444
445</sect3>
446
447<sect3>
448<title>NetBIOS Over TCP/IP Disabled</title>
449
450<para>
451<indexterm><primary>realm</primary></indexterm>
452<indexterm><primary>logon authentication</primary></indexterm>
453<indexterm><primary>DNS</primary></indexterm>
454<indexterm><primary>_ldap._tcp.pdc._msdcs.quenya.org</primary></indexterm>
455An MS Windows NT4/200x/XP Professional workstation in the realm <constant>quenya.org</constant>
456that has a need to affect user logon authentication will locate the domain controller by
457re-querying DNS servers for the <constant>_ldap._tcp.pdc._msdcs.quenya.org</constant> record.
458More information regarding this subject may be found in <link linkend="adsdnstech">DNS and Active Directory</link>.
459</para>
460
461</sect3>
462</sect2>
463</sect1>
464
465<sect1>
466<title>Backup Domain Controller Configuration</title>
467
468<para>
469<indexterm><primary>BDC</primary></indexterm>
470The creation of a BDC requires some steps to prepare the Samba server before
471&smbd; is executed for the first time. These steps are as follows:
472</para>
473
474<itemizedlist>
475 <listitem><para>
476 <indexterm><primary>secrets.tdb</primary></indexterm>
477 <indexterm><primary>smbpasswd</primary></indexterm>
478 <indexterm><primary>LDAP administration password</primary></indexterm>
479 Specification of the <smbconfoption name="ldap admin dn"/> is obligatory.
480 This also requires the LDAP administration password to be set in the <filename>secrets.tdb</filename>
481 using the <command>smbpasswd -w <replaceable>mysecret</replaceable></command>.
482 </para></listitem>
483
484 <listitem><para>
485 The <smbconfoption name="ldap suffix"/> parameter and the <smbconfoption name="ldap idmap suffix"/>
486 parameter must be specified in the &smb.conf; file.
487 </para></listitem>
488
489 <listitem><para>
490 <indexterm><primary>replication</primary><secondary>SAM</secondary></indexterm>
491 <indexterm><primary>user database</primary></indexterm>
492 <indexterm><primary>synchronized</primary></indexterm>
493 <indexterm><primary>NIS</primary></indexterm>
494 The UNIX user database has to be synchronized from the PDC to the
495 BDC. This means that both the <filename>/etc/passwd</filename> and
496 <filename>/etc/group</filename> have to be replicated from the PDC
497 to the BDC. This can be done manually whenever changes are made.
498 Alternately, the PDC is set up as an NIS master server and the BDC as an NIS slave
499 server. To set up the BDC as a mere NIS client would not be enough,
500 as the BDC would not be able to access its user database in case of
501 a PDC failure. NIS is by no means the only method to synchronize
502 passwords. An LDAP solution would also work.
503 </para>
504 </listitem>
505
506 <listitem><para>
507 <indexterm><primary>password database</primary></indexterm>
508 <indexterm><primary>replicated</primary></indexterm>
509 <indexterm><primary>PDC</primary></indexterm>
510 <indexterm><primary>BDC</primary></indexterm>
511 <indexterm><primary>smbpasswd</primary></indexterm>
512 <indexterm><primary>rsync</primary></indexterm>
513 <indexterm><primary>ssh</primary></indexterm>
514 <indexterm><primary>LDAP</primary></indexterm>
515 The Samba password database must be replicated from the PDC to the BDC.
516 The solution
517 is to set up slave LDAP servers for each BDC and a master LDAP server for the PDC.
518 The use of rsync is inherently flawed by the fact that the data will be replicated
519 at timed intervals. There is no guarantee that the BDC will be operating at all
520 times with correct and current machine and user account information. This means that
521 this method runs the risk of users being inconvenienced by discontinuity of access
522 to network services due to inconsistent security data. It must be born in mind that
523 Windows workstations update (change) the machine trust account password at regular
524 intervals &smbmdash; administrators are not normally aware that this is happening
525 or when it takes place.
526 </para>
527
528 <para>
529 <indexterm><primary>POSIX</primary></indexterm>
530 <indexterm><primary>LDAP</primary></indexterm>
531 <indexterm><primary>SambaSAMAccount</primary></indexterm>
532 <indexterm><primary>synchronize</primary></indexterm>
533 The use of LDAP for both the POSIX (UNIX user and group) accounts and for the
534 SambaSAMAccount data automatically ensures that all account change information
535 will be written to the shared directory. This eliminates the need for any special
536 action to synchronize account information because LDAP will meet that requirement.
537 </para></listitem>
538
539 <listitem><para>
540 <indexterm><primary>netlogon share</primary></indexterm>
541 <indexterm><primary>replicate</primary></indexterm>
542 <indexterm><primary>PDC</primary></indexterm>
543 <indexterm><primary>BDC</primary></indexterm>
544 <indexterm><primary>cron</primary></indexterm>
545 <indexterm><primary>rsync</primary></indexterm>
546 The netlogon share has to be replicated from the PDC to the BDC. This can be done manually whenever login
547 scripts are changed, or it can be done automatically using a <command>cron</command> job that will replicate
548 the directory structure in this share using a tool like <command>rsync</command>. The use of
549 <command>rsync</command> for replication of the netlogon data is not critical to network security and is one
550 that can be manually managed given that the administrator will make all changes to the netlogon share as part
551 of a conscious move.
552 </para></listitem>
553
554</itemizedlist>
555
556<sect2>
557<title>Example Configuration</title>
558
559<para>
560Finally, the BDC has to be capable of being found by the workstations. This can be done by configuring the
561Samba &smb.conf; file <smbconfsection name="[global]"/> section as shown in <link linkend="minim-bdc">Minimal
562Setup for Being a BDC</link>.
563</para>
564
565<example id="minim-bdc">
566<title>Minimal Setup for Being a BDC</title>
567<smbconfblock>
568<smbconfoption name="workgroup">&example.workgroup;</smbconfoption>
569<smbconfoption name="passdb backend">ldapsam:ldap://slave-ldap.quenya.org</smbconfoption>
570<smbconfoption name="domain master">no</smbconfoption>
571<smbconfoption name="domain logons">yes</smbconfoption>
572<smbconfoption name="ldap suffix">dc=abmas,dc=biz</smbconfoption>
573<smbconfoption name="ldap user suffix">ou=Users</smbconfoption>
574<smbconfoption name="ldap group suffix">ou=Groups</smbconfoption>
575<smbconfoption name="ldap machine suffix">ou=Computers</smbconfoption>
576<smbconfoption name="ldap idmap suffix">ou=Idmap</smbconfoption>
577<smbconfoption name="ldap admin dn">cn=sambadmin,dc=quenya,dc=org</smbconfoption>
578<smbconfoption name="idmap backend">ldap:ldap://master-ldap.quenya.org</smbconfoption>
579<smbconfoption name="idmap uid">10000-20000</smbconfoption>
580<smbconfoption name="idmap gid">10000-20000</smbconfoption>
581</smbconfblock>
582</example>
583
584<para>
585Fully documented working example network configurations using OpenLDAP and Samba
586as available in the <ulink url="http://www.samba.org/samba/docs/Samba3-ByExample">book</ulink> <quote>Samba-3
587by Example</quote> that may be obtained from local and on-line book stores.
588</para>
589
590<para>
591<indexterm><primary>BDC</primary></indexterm>
592<indexterm><primary>NetBIOS</primary></indexterm>
593<indexterm><primary>group</primary></indexterm>
594<indexterm><primary>PDC</primary></indexterm>
595This configuration causes the BDC to register only the name MIDEARTH&lt;1C&gt; with the WINS server. This is
596not a problem, as the name MIDEARTH&lt;1C&gt; is a NetBIOS group name that is meant to be registered by more
597than one machine. The parameter <smbconfoption name="domain master">no</smbconfoption> forces the BDC not to
598register MIDEARTH&lt;1B&gt;, which is a unique NetBIOS name that is reserved for the PDC.
599</para>
600
601<para>
602<indexterm><primary>idmap backend</primary></indexterm>
603<indexterm><primary>winbindd</primary></indexterm>
604<indexterm><primary>redirect</primary></indexterm>
605<indexterm><primary>winbindd</primary></indexterm>
606<indexterm><primary>LDAP database</primary></indexterm>
607<indexterm><primary>UID</primary></indexterm>
608<indexterm><primary>GID</primary></indexterm>
609<indexterm><primary>SID</primary></indexterm>
610<indexterm><primary>nss_ldap</primary></indexterm>
611The <parameter>idmap backend</parameter> will redirect the <command>winbindd</command> utility to use the LDAP
612database to store all mappings for Windows SIDs to UIDs and GIDs for UNIX accounts in a repository that is
613shared. The BDC will however depend on local resolution of UIDs and GIDs via NSS and the
614<command>nss_ldap</command> utility.
615</para>
616
617<note><para>
618<indexterm><primary>Server Type</primary><secondary>Domain Member</secondary></indexterm>
619<indexterm><primary>ID mapping</primary></indexterm>
620<indexterm><primary>domain member server</primary></indexterm>
621<indexterm><primary>idmap backend</primary></indexterm>
622Samba has introduced a new ID mapping facility. One of the features of this facility is that it
623allows greater flexibility in how user and group IDs are handled in respect to NT domain user and group
624SIDs. One of the new facilities provides for explicitly ensuring that UNIX/Linux UID and GID values
625will be consistent on the PDC, all BDCs, and all domain member servers. The parameter that controls this
626is called <parameter>idmap backend</parameter>. Please refer to the man page for &smb.conf; for more information
627regarding its behavior.
628</para></note>
629
630<para>
631<indexterm><primary>BDC</primary></indexterm>
632<indexterm><primary>winbindd</primary></indexterm>
633<indexterm><primary>domain member servers</primary></indexterm>
634The use of the <smbconfoption name="idmap backend">ldap:ldap://master.quenya.org</smbconfoption>
635option on a BDC only makes sense where ldapsam is used on a PDC. The purpose of an LDAP-based idmap backend is
636also to allow a domain member (without its own passdb backend) to use winbindd to resolve Windows network users
637and groups to common UID/GIDs. In other words, this option is generally intended for use on BDCs and on domain
638member servers.
639</para>
640
641</sect2>
642</sect1>
643
644<sect1>
645<title>Common Errors</title>
646
647<para>
648<indexterm><primary>domain control</primary></indexterm>
649Domain control was a new area for Samba, but there are now many examples that we may refer to.
650Updated information will be published as they become available and may be found in later Samba releases or
651from the Samba Web <ulink url="http://samba.org">site</ulink>; refer in particular to the
652<filename>WHATSNEW.txt</filename> in the Samba release tarball. The book, <quote>Samba-3 by Example</quote>
653documents well tested and proven configuration examples. You can obtain a copy of this
654<ulink url="http://www.samba.org/samba/docs/Samba3-ByExample.pdf">book</ulink> for the Samba web site.
655</para>
656
657<sect2>
658<title>Machine Accounts Keep Expiring</title>
659
660<para>
661<indexterm><primary>Machine Trust Accounts</primary></indexterm>
662<indexterm><primary>passdb</primary></indexterm>
663<indexterm><primary>SAM</primary></indexterm>
664<indexterm><primary>Local Machine Trust Account</primary></indexterm>
665This problem will occur when the passdb (SAM) files are copied from a central
666server but the local BDC is acting as a PDC. This results in the application of
667Local Machine Trust Account password updates to the local SAM. Such updates
668are not copied back to the central server. The newer machine account password is then
669overwritten when the SAM is recopied from the PDC. The result is that the domain member machine
670on startup will find that its passwords do not match the one now in the database, and
671since the startup security check will now fail, this machine will not allow logon attempts
672to proceed and the account expiry error will be reported.
673</para>
674
675<para>
676The solution is to use a more robust passdb backend, such as the ldapsam backend, setting up
677a slave LDAP server for each BDC and a master LDAP server for the PDC.
678</para>
679
680</sect2>
681
682<sect2>
683<title>Can Samba Be a Backup Domain Controller to an NT4 PDC?</title>
684
685<para>
686<indexterm><primary>replication</primary><secondary>SAM</secondary></indexterm>
687<indexterm><primary>SAM</primary></indexterm>
688No. The native NT4 SAM replication protocols have not yet been fully implemented.
689</para>
690
691<para>
692<indexterm><primary>BDC</primary></indexterm>
693<indexterm><primary>PDC</primary></indexterm>
694<indexterm><primary>logon requests</primary></indexterm>
695Can I get the benefits of a BDC with Samba? Yes, but only to a Samba
696PDC or as a <ulink
697url="https://wiki.samba.org/index.php/Samba4/HOWTO">Samba 4.0 Active
698Directory domain controller.</ulink> The
699main reason for implementing a BDC is availability. If the PDC is a Samba
700machine, a second Samba machine can be set up to service logon requests whenever
701the PDC is down.
702</para>
703
704</sect2>
705
706</sect1>
707</chapter>
Note: See TracBrowser for help on using the repository browser.