This commit was manufactured by cvs2svn to create branch 'SAMBA_3_0'.(This used to...
[kai/samba.git] / docs / htmldocs / Samba-BDC-HOWTO.html
1 <HTML
2 ><HEAD
3 ><TITLE
4 >How to Act as a Backup Domain Controller in a Purely Samba Controlled Domain</TITLE
5 ><META
6 NAME="GENERATOR"
7 CONTENT="Modular DocBook HTML Stylesheet Version 1.57"></HEAD
8 ><BODY
9 CLASS="ARTICLE"
10 BGCOLOR="#FFFFFF"
11 TEXT="#000000"
12 LINK="#0000FF"
13 VLINK="#840084"
14 ALINK="#0000FF"
15 ><DIV
16 CLASS="ARTICLE"
17 ><DIV
18 CLASS="TITLEPAGE"
19 ><H1
20 CLASS="TITLE"
21 ><A
22 NAME="SAMBA-BDC"
23 >How to Act as a Backup Domain Controller in a Purely Samba Controlled Domain</A
24 ></H1
25 ><HR></DIV
26 ><DIV
27 CLASS="SECT1"
28 ><H1
29 CLASS="SECT1"
30 ><A
31 NAME="AEN3"
32 >Prerequisite Reading</A
33 ></H1
34 ><P
35 >Before you continue reading in this chapter, please make sure
36 that you are comfortable with configuring a Samba PDC
37 as described in the <A
38 HREF="Samba-PDC-HOWTO.html"
39 TARGET="_top"
40 >Samba-PDC-HOWTO</A
41 >.</P
42 ></DIV
43 ><DIV
44 CLASS="SECT1"
45 ><HR><H1
46 CLASS="SECT1"
47 ><A
48 NAME="AEN7"
49 >Background</A
50 ></H1
51 ><P
52 >What is a Domain Controller? It is a machine that is able to answer
53 logon requests from workstations in a Windows NT Domain. Whenever a
54 user logs into a Windows NT Workstation, the workstation connects to a
55 Domain Controller and asks him whether the username and password the
56 user typed in is correct.  The Domain Controller replies with a lot of
57 information about the user, for example the place where the users
58 profile is stored, the users full name of the user. All this
59 information is stored in the NT user database, the so-called SAM.</P
60 ><P
61 >There are two kinds of Domain Controller in a NT 4 compatible Domain:
62 A Primary Domain Controller (PDC) and one or more Backup Domain
63 Controllers (BDC). The PDC contains the master copy of the
64 SAM. Whenever the SAM has to change, for example when a user changes
65 his password, this change has to be done on the PDC. A Backup Domain
66 Controller is a machine that maintains a read-only copy of the
67 SAM. This way it is able to reply to logon requests and authenticate
68 users in case the PDC is not available. During this time no changes to
69 the SAM are possible. Whenever changes to the SAM are done on the PDC,
70 all BDC receive the changes from the PDC.</P
71 ><P
72 >Since version 2.2 Samba officially supports domain logons for all
73 current Windows Clients, including Windows 2000 and XP. This text
74 assumes the domain to be named SAMBA. To be able to act as a PDC, some
75 parameters in the [global]-section of the smb.conf have to be set:</P
76 ><P
77 ><PRE
78 CLASS="PROGRAMLISTING"
79 >workgroup = SAMBA
80 domain master = yes
81 domain logons = yes</PRE
82 ></P
83 ><P
84 >Several other things like a [homes] and a [netlogon] share also may be
85 set along with settings for the profile path, the users home drive and
86 others. This will not be covered in this document.</P
87 ></DIV
88 ><DIV
89 CLASS="SECT1"
90 ><HR><H1
91 CLASS="SECT1"
92 ><A
93 NAME="AEN15"
94 >What qualifies a Domain Controller on the network?</A
95 ></H1
96 ><P
97 >Every machine that is a Domain Controller for the domain SAMBA has to
98 register the NetBIOS group name SAMBA#1c with the WINS server and/or
99 by broadcast on the local network. The PDC also registers the unique
100 NetBIOS name SAMBA#1b with the WINS server. The name type #1b is
101 normally reserved for the domain master browser, a role that has
102 nothing to do with anything related to authentication, but the
103 Microsoft Domain implementation requires the domain master browser to
104 be on the same machine as the PDC.</P
105 ><DIV
106 CLASS="SECT2"
107 ><HR><H2
108 CLASS="SECT2"
109 ><A
110 NAME="AEN18"
111 >How does a Workstation find its domain controller?</A
112 ></H2
113 ><P
114 >A NT workstation in the domain SAMBA that wants a local user to be
115 authenticated has to find the domain controller for SAMBA. It does
116 this by doing a NetBIOS name query for the group name SAMBA#1c. It
117 assumes that each of the machines it gets back from the queries is a
118 domain controller and can answer logon requests. To not open security
119 holes both the workstation and the selected (TODO: How is the DC
120 chosen) domain controller authenticate each other. After that the
121 workstation sends the user's credentials (his name and password) to
122 the domain controller, asking for approval.</P
123 ></DIV
124 ><DIV
125 CLASS="SECT2"
126 ><HR><H2
127 CLASS="SECT2"
128 ><A
129 NAME="AEN21"
130 >When is the PDC needed?</A
131 ></H2
132 ><P
133 >Whenever a user wants to change his password, this has to be done on
134 the PDC. To find the PDC, the workstation does a NetBIOS name query
135 for SAMBA#1b, assuming this machine maintains the master copy of the
136 SAM. The workstation contacts the PDC, both mutually authenticate and
137 the password change is done.</P
138 ></DIV
139 ></DIV
140 ><DIV
141 CLASS="SECT1"
142 ><HR><H1
143 CLASS="SECT1"
144 ><A
145 NAME="AEN24"
146 >Can Samba be a Backup Domain Controller?</A
147 ></H1
148 ><P
149 >With version 2.2, no. The native NT SAM replication protocols have
150 not yet been fully implemented. The Samba Team is working on
151 understanding and implementing the protocols, but this work has not
152 been finished for version 2.2.</P
153 ><P
154 >Can I get the benefits of a BDC with Samba?  Yes. The main reason for
155 implementing a BDC is availability. If the PDC is a Samba machine,
156 a second Samba machine can be set up to
157 service logon requests whenever the PDC is down.</P
158 ></DIV
159 ><DIV
160 CLASS="SECT1"
161 ><HR><H1
162 CLASS="SECT1"
163 ><A
164 NAME="AEN28"
165 >How do I set up a Samba BDC?</A
166 ></H1
167 ><P
168 >Several things have to be done:</P
169 ><P
170 ></P
171 ><UL
172 ><LI
173 ><P
174 >The file private/MACHINE.SID identifies the domain. When a samba
175 server is first started, it is created on the fly and must never be
176 changed again. This file has to be the same on the PDC and the BDC,
177 so the MACHINE.SID has to be copied from the PDC to the BDC.</P
178 ></LI
179 ><LI
180 ><P
181 >The Unix user database has to be synchronized from the PDC to the
182 BDC. This means that both the /etc/passwd and /etc/group have to be
183 replicated from the PDC to the BDC. This can be done manually
184 whenever changes are made, or the PDC is set up as a NIS master
185 server and the BDC as a NIS slave server. To set up the BDC as a
186 mere NIS client would not be enough, as the BDC would not be able to
187 access its user database in case of a PDC failure.</P
188 ></LI
189 ><LI
190 ><P
191 >The Samba password database in the file private/smbpasswd has to be
192 replicated from the PDC to the BDC. This is a bit tricky, see the
193 next section.</P
194 ></LI
195 ><LI
196 ><P
197 >Any netlogon share has to be replicated from the PDC to the
198 BDC. This can be done manually whenever login scripts are changed,
199 or it can be done automatically together with the smbpasswd
200 synchronization.</P
201 ></LI
202 ></UL
203 ><P
204 >Finally, the BDC has to be found by the workstations. This can be done
205 by setting</P
206 ><P
207 ><PRE
208 CLASS="PROGRAMLISTING"
209 >workgroup = samba
210 domain master = no
211 domain logons = yes</PRE
212 ></P
213 ><P
214 >in the [global]-section of the smb.conf of the BDC. This makes the BDC
215 only register the name SAMBA#1c with the WINS server. This is no
216 problem as the name SAMBA#1c is a NetBIOS group name that is meant to
217 be registered by more than one machine. The parameter 'domain master =
218 no' forces the BDC not to register SAMBA#1b which as a unique NetBIOS
219 name is reserved for the Primary Domain Controller.</P
220 ><DIV
221 CLASS="SECT2"
222 ><HR><H2
223 CLASS="SECT2"
224 ><A
225 NAME="AEN44"
226 >How do I replicate the smbpasswd file?</A
227 ></H2
228 ><P
229 >Replication of the smbpasswd file is sensitive. It has to be done
230 whenever changes to the SAM are made. Every user's password change is
231 done in the smbpasswd file and has to be replicated to the BDC. So
232 replicating the smbpasswd file very often is necessary.</P
233 ><P
234 >As the smbpasswd file contains plain text password equivalents, it
235 must not be sent unencrypted over the wire. The best way to set up
236 smbpasswd replication from the PDC to the BDC is to use the utility
237 rsync. rsync can use ssh as a transport. ssh itself can be set up to
238 accept *only* rsync transfer without requiring the user to type a
239 password.</P
240 ></DIV
241 ></DIV
242 ></DIV
243 ></BODY
244 ></HTML
245 >