0a8a8fa2e1a5274dbcab00590c3c85035c6007fb
[gd/samba-autobuild/.git] / docs / htmldocs / samba-bdc.html
1 <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
2 <html><head><meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1"><title>Chapter 6. 
3 Samba Backup Domain Controller to Samba Domain Control
4 </title><link rel="stylesheet" href="samba.css" type="text/css"><meta name="generator" content="DocBook XSL Stylesheets V1.59.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. 
5 Samba as an NT4 or Win2k Primary Domain Controller
6 "><link rel="next" href="ADS.html" title="Chapter 7. Samba as a ADS domain member"></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. 
7 Samba Backup Domain Controller to Samba Domain Control
8 </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="ADS.html">Next</a></td></tr></table><hr></div><div class="chapter" lang="en"><div class="titlepage"><div><h2 class="title"><a name="samba-bdc"></a>Chapter 6. 
9 Samba Backup Domain Controller to Samba Domain Control
10 </h2></div><div><div class="author"><h3 class="author">Volker Lendecke</h3><div class="affiliation"><span class="orgname">Samba Team<br></span><div class="address"><p><tt>&lt;<a href="mailto:Volker.Lendecke@SerNet.DE">Volker.Lendecke@SerNet.DE</a>&gt;</tt></p></div></div></div></div><div><p class="pubdate"> (26 Apr 2001) </p></div></div><div class="toc"><p><b>Table of Contents</b></p><dl><dt><a href="samba-bdc.html#id2807541">Prerequisite Reading</a></dt><dt><a href="samba-bdc.html#id2877190">Background</a></dt><dt><a href="samba-bdc.html#id2879061">What qualifies a Domain Controller on the network?</a></dt><dd><dl><dt><a href="samba-bdc.html#id2879083">How does a Workstation find its domain controller?</a></dt><dt><a href="samba-bdc.html#id2879107">When is the PDC needed?</a></dt></dl></dd><dt><a href="samba-bdc.html#id2879127">Can Samba be a Backup Domain Controller to an NT PDC?</a></dt><dt><a href="samba-bdc.html#id2879160">How do I set up a Samba BDC?</a></dt><dd><dl><dt><a href="samba-bdc.html#id2879257">How do I replicate the smbpasswd file?</a></dt><dt><a href="samba-bdc.html#id2879286">Can I do this all with LDAP?</a></dt></dl></dd></dl></div><div class="sect1" lang="en"><div class="titlepage"><div><h2 class="title" style="clear: both"><a name="id2807541"></a>Prerequisite Reading</h2></div></div><p>
11 Before you continue reading in this chapter, please make sure
12 that you are comfortable with configuring a Samba PDC
13 as described in the <a href="Samba-PDC-HOWTO.html" target="_top">Samba-PDC-HOWTO</a>.
14 </p></div><div class="sect1" lang="en"><div class="titlepage"><div><h2 class="title" style="clear: both"><a name="id2877190"></a>Background</h2></div></div><p>
15 What is a Domain Controller? It is a machine that is able to answer
16 logon requests from workstations in a Windows NT Domain. Whenever a
17 user logs into a Windows NT Workstation, the workstation connects to a
18 Domain Controller and asks him whether the username and password the
19 user typed in is correct.  The Domain Controller replies with a lot of
20 information about the user, for example the place where the users
21 profile is stored, the users full name of the user. All this
22 information is stored in the NT user database, the so-called SAM.
23 </p><p>
24 There are two kinds of Domain Controller in a NT 4 compatible Domain:
25 A Primary Domain Controller (PDC) and one or more Backup Domain
26 Controllers (BDC). The PDC contains the master copy of the
27 SAM. Whenever the SAM has to change, for example when a user changes
28 his password, this change has to be done on the PDC. A Backup Domain
29 Controller is a machine that maintains a read-only copy of the
30 SAM. This way it is able to reply to logon requests and authenticate
31 users in case the PDC is not available. During this time no changes to
32 the SAM are possible. Whenever changes to the SAM are done on the PDC,
33 all BDC receive the changes from the PDC.
34 </p><p>
35 Since version 2.2 Samba officially supports domain logons for all
36 current Windows Clients, including Windows 2000 and XP. This text
37 assumes the domain to be named SAMBA. To be able to act as a PDC, some
38 parameters in the [global]-section of the smb.conf have to be set:
39 </p><pre class="programlisting">
40         workgroup = SAMBA
41         domain master = yes
42         domain logons = yes
43 </pre><p>
44 Several other things like a [homes] and a [netlogon] share also may be
45 set along with settings for the profile path, the users home drive and
46 others. This will not be covered in this document.
47 </p></div><div class="sect1" lang="en"><div class="titlepage"><div><h2 class="title" style="clear: both"><a name="id2879061"></a>What qualifies a Domain Controller on the network?</h2></div></div><p>
48 Every machine that is a Domain Controller for the domain SAMBA has to
49 register the NetBIOS group name SAMBA#1c with the WINS server and/or
50 by broadcast on the local network. The PDC also registers the unique
51 NetBIOS name SAMBA#1b with the WINS server. The name type #1b is
52 normally reserved for the domain master browser, a role that has
53 nothing to do with anything related to authentication, but the
54 Microsoft Domain implementation requires the domain master browser to
55 be on the same machine as the PDC.
56 </p><div class="sect2" lang="en"><div class="titlepage"><div><h3 class="title"><a name="id2879083"></a>How does a Workstation find its domain controller?</h3></div></div><p>
57 A NT workstation in the domain SAMBA that wants a local user to be
58 authenticated has to find the domain controller for SAMBA. It does
59 this by doing a NetBIOS name query for the group name SAMBA#1c. It
60 assumes that each of the machines it gets back from the queries is a
61 domain controller and can answer logon requests. To not open security
62 holes both the workstation and the selected (TODO: How is the DC
63 chosen) domain controller authenticate each other. After that the
64 workstation sends the user's credentials (his name and password) to
65 the domain controller, asking for approval.
66 </p></div><div class="sect2" lang="en"><div class="titlepage"><div><h3 class="title"><a name="id2879107"></a>When is the PDC needed?</h3></div></div><p>
67 Whenever a user wants to change his password, this has to be done on
68 the PDC. To find the PDC, the workstation does a NetBIOS name query
69 for SAMBA#1b, assuming this machine maintains the master copy of the
70 SAM. The workstation contacts the PDC, both mutually authenticate and
71 the password change is done.
72 </p></div></div><div class="sect1" lang="en"><div class="titlepage"><div><h2 class="title" style="clear: both"><a name="id2879127"></a>Can Samba be a Backup Domain Controller to an NT PDC?</h2></div></div><p>
73 With version 2.2, no. The native NT SAM replication protocols have
74 not yet been fully implemented. The Samba Team is working on
75 understanding and implementing the protocols, but this work has not
76 been finished for version 2.2.
77 </p><p>
78 With version 3.0, the work on both the replication protocols and a
79 suitable storage mechanism has progressed, and some form of NT4 BDC
80 support is expected soon.
81 </p><p>
82 Can I get the benefits of a BDC with Samba?  Yes. The main reason for
83 implementing a BDC is availability. If the PDC is a Samba machine,
84 a second Samba machine can be set up to
85 service logon requests whenever the PDC is down.
86 </p></div><div class="sect1" lang="en"><div class="titlepage"><div><h2 class="title" style="clear: both"><a name="id2879160"></a>How do I set up a Samba BDC?</h2></div></div><p>
87 Several things have to be done:
88 </p><div class="itemizedlist"><ul type="disc"><li><p>
89 The domain SID has to be the same on the PDC and the BDC. This used to
90 be stored in the file private/MACHINE.SID. This file is not created
91 anymore since Samba 2.2.5 or even earlier. Nowadays the domain SID is
92 stored in the file private/secrets.tdb. Simply copying the secrets.tdb
93 from the PDC to the BDC does not work, as the BDC would
94 generate a new SID for itself and override the domain SID with this
95 new BDC SID.</p><p>
96 To retrieve the domain SID from the PDC or an existing BDC and store it in the
97 secrets.tdb, execute 'net rpc getsid' on the BDC.
98 </p></li><li><p>
99 The Unix user database has to be synchronized from the PDC to the
100 BDC. This means that both the /etc/passwd and /etc/group have to be
101 replicated from the PDC to the BDC. This can be done manually
102 whenever changes are made, or the PDC is set up as a NIS master
103 server and the BDC as a NIS slave server. To set up the BDC as a
104 mere NIS client would not be enough, as the BDC would not be able to
105 access its user database in case of a PDC failure.
106 </p></li><li><p>
107 The Samba password database in the file private/smbpasswd has to be
108 replicated from the PDC to the BDC. This is a bit tricky, see the
109 next section.
110 </p></li><li><p>
111 Any netlogon share has to be replicated from the PDC to the
112 BDC. This can be done manually whenever login scripts are changed,
113 or it can be done automatically together with the smbpasswd
114 synchronization.
115 </p></li></ul></div><p>
116 Finally, the BDC has to be found by the workstations. This can be done
117 by setting
118 </p><pre class="programlisting">
119         workgroup = samba
120         domain master = no
121         domain logons = yes
122 </pre><p>
123 in the [global]-section of the smb.conf of the BDC. This makes the BDC
124 only register the name SAMBA#1c with the WINS server. This is no
125 problem as the name SAMBA#1c is a NetBIOS group name that is meant to
126 be registered by more than one machine. The parameter 'domain master =
127 no' forces the BDC not to register SAMBA#1b which as a unique NetBIOS
128 name is reserved for the Primary Domain Controller.
129 </p><div class="sect2" lang="en"><div class="titlepage"><div><h3 class="title"><a name="id2879257"></a>How do I replicate the smbpasswd file?</h3></div></div><p>
130 Replication of the smbpasswd file is sensitive. It has to be done
131 whenever changes to the SAM are made. Every user's password change is
132 done in the smbpasswd file and has to be replicated to the BDC. So
133 replicating the smbpasswd file very often is necessary.
134 </p><p>
135 As the smbpasswd file contains plain text password equivalents, it
136 must not be sent unencrypted over the wire. The best way to set up
137 smbpasswd replication from the PDC to the BDC is to use the utility
138 rsync. rsync can use ssh as a transport. ssh itself can be set up to
139 accept *only* rsync transfer without requiring the user to type a
140 password.
141 </p></div><div class="sect2" lang="en"><div class="titlepage"><div><h3 class="title"><a name="id2879286"></a>Can I do this all with LDAP?</h3></div></div><p>The simple answer is YES.  Samba's pdb_ldap code supports
142 binding to a replica LDAP server, and will also follow referrals and
143 rebind to the master if it ever needs to make a modification to the
144 database.  (Normally BDCs are read only, so this will not occur
145 often).
146 </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="ADS.html">Next</a></td></tr><tr><td width="40%" align="left" valign="top">Chapter 5. 
147 Samba as an NT4 or Win2k Primary Domain Controller
148  </td><td width="20%" align="center"><a accesskey="h" href="index.html">Home</a></td><td width="40%" align="right" valign="top"> Chapter 7. Samba as a ADS domain member</td></tr></table></div></body></html>