This commit was manufactured by cvs2svn to create branch 'SAMBA_3_0'.(This used to...
[jra/samba/.git] / docs / htmldocs / DOMAIN_MEMBER.html
1 <HTML
2 ><HEAD
3 ><TITLE
4 >security = domain in Samba 2.x</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="DOMAIN-SECURITY"
23 >security = domain in Samba 2.x</A
24 ></H1
25 ><HR></DIV
26 ><DIV
27 CLASS="SECT1"
28 ><H1
29 CLASS="SECT1"
30 ><A
31 NAME="AEN3"
32 >Joining an NT Domain with Samba 2.2</A
33 ></H1
34 ><P
35 >Assume you have a Samba 2.x server with a NetBIOS name of 
36         <TT
37 CLASS="CONSTANT"
38 >SERV1</TT
39 > and are joining an NT domain called
40         <TT
41 CLASS="CONSTANT"
42 >DOM</TT
43 >, which has a PDC with a NetBIOS name
44         of <TT
45 CLASS="CONSTANT"
46 >DOMPDC</TT
47 > and two backup domain controllers 
48         with NetBIOS names <TT
49 CLASS="CONSTANT"
50 >DOMBDC1</TT
51 > and <TT
52 CLASS="CONSTANT"
53 >DOMBDC2
54         </TT
55 >.</P
56 ><P
57 >In order to join the domain, first stop all Samba daemons 
58         and run the command:</P
59 ><P
60 ><TT
61 CLASS="PROMPT"
62 >root# </TT
63 ><TT
64 CLASS="USERINPUT"
65 ><B
66 >smbpasswd -j DOM -r DOMPDC
67         -U<TT
68 CLASS="REPLACEABLE"
69 ><I
70 >Administrator%password</I
71 ></TT
72 ></B
73 ></TT
74 ></P
75 ><P
76 >as we are joining the domain DOM and the PDC for that domain 
77         (the only machine that has write access to the domain SAM database) 
78         is DOMPDC. The <TT
79 CLASS="REPLACEABLE"
80 ><I
81 >Administrator%password</I
82 ></TT
83 > is 
84         the login name and password for an account which has the necessary 
85         privilege to add machines to the domain.  If this is successful 
86         you will see the message:</P
87 ><P
88 ><TT
89 CLASS="COMPUTEROUTPUT"
90 >smbpasswd: Joined domain DOM.</TT
91 >
92         </P
93 ><P
94 >in your terminal window. See the <A
95 HREF="smbpasswd.8.html"
96 TARGET="_top"
97 >       smbpasswd(8)</A
98 > man page for more details.</P
99 ><P
100 >There is existing development code to join a domain
101         without having to create the machine trust account on the PDC
102         beforehand.  This code will hopefully be available soon
103         in release branches as well.</P
104 ><P
105 >This command goes through the machine account password 
106         change protocol, then writes the new (random) machine account 
107         password for this Samba server into a file in the same directory 
108         in which an smbpasswd file would be stored - normally :</P
109 ><P
110 ><TT
111 CLASS="FILENAME"
112 >/usr/local/samba/private</TT
113 ></P
114 ><P
115 >In Samba 2.0.x, the filename looks like this:</P
116 ><P
117 ><TT
118 CLASS="FILENAME"
119 ><TT
120 CLASS="REPLACEABLE"
121 ><I
122 >&lt;NT DOMAIN NAME&gt;</I
123 ></TT
124 >.<TT
125 CLASS="REPLACEABLE"
126 ><I
127 >&lt;Samba 
128         Server Name&gt;</I
129 ></TT
130 >.mac</TT
131 ></P
132 ><P
133 >The <TT
134 CLASS="FILENAME"
135 >.mac</TT
136 > suffix stands for machine account 
137         password file. So in our example above, the file would be called:</P
138 ><P
139 ><TT
140 CLASS="FILENAME"
141 >DOM.SERV1.mac</TT
142 ></P
143 ><P
144 >In Samba 2.2, this file has been replaced with a TDB 
145         (Trivial Database) file named <TT
146 CLASS="FILENAME"
147 >secrets.tdb</TT
148 >.
149         </P
150 ><P
151 >This file is created and owned by root and is not 
152         readable by any other user. It is the key to the domain-level 
153         security for your system, and should be treated as carefully 
154         as a shadow password file.</P
155 ><P
156 >Now, before restarting the Samba daemons you must 
157         edit your <A
158 HREF="smb.conf.5.html"
159 TARGET="_top"
160 ><TT
161 CLASS="FILENAME"
162 >smb.conf(5)</TT
163 >
164         </A
165 > file to tell Samba it should now use domain security.</P
166 ><P
167 >Change (or add) your <A
168 HREF="smb.conf.5.html#SECURITY"
169 TARGET="_top"
170 >       <TT
171 CLASS="PARAMETER"
172 ><I
173 >security =</I
174 ></TT
175 ></A
176 > line in the [global] section 
177         of your smb.conf to read:</P
178 ><P
179 ><B
180 CLASS="COMMAND"
181 >security = domain</B
182 ></P
183 ><P
184 >Next change the <A
185 HREF="smb.conf.5.html#WORKGROUP"
186 TARGET="_top"
187 ><TT
188 CLASS="PARAMETER"
189 ><I
190 >       workgroup =</I
191 ></TT
192 ></A
193 > line in the [global] section to read: </P
194 ><P
195 ><B
196 CLASS="COMMAND"
197 >workgroup = DOM</B
198 ></P
199 ><P
200 >as this is the name of the domain we are joining. </P
201 ><P
202 >You must also have the parameter <A
203 HREF="smb.conf.5.html#ENCRYPTPASSWORDS"
204 TARGET="_top"
205 >       <TT
206 CLASS="PARAMETER"
207 ><I
208 >encrypt passwords</I
209 ></TT
210 ></A
211 > set to <TT
212 CLASS="CONSTANT"
213 >yes
214         </TT
215 > in order for your users to authenticate to the NT PDC.</P
216 ><P
217 >Finally, add (or modify) a <A
218 HREF="smb.conf.5.html#PASSWORDSERVER"
219 TARGET="_top"
220 >       <TT
221 CLASS="PARAMETER"
222 ><I
223 >password server =</I
224 ></TT
225 ></A
226 > line in the [global]
227         section to read: </P
228 ><P
229 ><B
230 CLASS="COMMAND"
231 >password server = DOMPDC DOMBDC1 DOMBDC2</B
232 ></P
233 ><P
234 >These are the primary and backup domain controllers Samba 
235         will attempt to contact in order to authenticate users. Samba will 
236         try to contact each of these servers in order, so you may want to 
237         rearrange this list in order to spread out the authentication load 
238         among domain controllers.</P
239 ><P
240 >Alternatively, if you want smbd to automatically determine 
241         the list of Domain controllers to use for authentication, you may 
242         set this line to be :</P
243 ><P
244 ><B
245 CLASS="COMMAND"
246 >password server = *</B
247 ></P
248 ><P
249 >This method, which was introduced in Samba 2.0.6, 
250         allows Samba to use exactly the same mechanism that NT does. This 
251         method either broadcasts or uses a WINS database in order to
252         find domain controllers to authenticate against.</P
253 ><P
254 >Finally, restart your Samba daemons and get ready for 
255         clients to begin using domain security!</P
256 ></DIV
257 ><DIV
258 CLASS="SECT1"
259 ><HR><H1
260 CLASS="SECT1"
261 ><A
262 NAME="AEN67"
263 >Samba and Windows 2000 Domains</A
264 ></H1
265 ><P
266 >Many people have asked regarding the state of Samba's ability to participate in
267 a Windows 2000 Domain.  Samba 2.2 is able to act as a member server of a Windows
268 2000 domain operating in mixed or native mode.</P
269 ><P
270 >There is much confusion between the circumstances that require a "mixed" mode
271 Win2k DC and a when this host can be switched to "native" mode.  A "mixed" mode
272 Win2k domain controller is only needed if Windows NT BDCs must exist in the same
273 domain.  By default, a Win2k DC in "native" mode will still support
274 NetBIOS and NTLMv1 for authentication of legacy clients such as Windows 9x and 
275 NT 4.0.  Samba has the same requirements as a Windows NT 4.0 member server.</P
276 ><P
277 >The steps for adding a Samba 2.2 host to a Win2k domain are the same as those
278 for adding a Samba server to a Windows NT 4.0 domain. The only exception is that 
279 the "Server Manager" from NT 4 has been replaced by the "Active Directory Users and 
280 Computers" MMC (Microsoft Management Console) plugin.</P
281 ></DIV
282 ><DIV
283 CLASS="SECT1"
284 ><HR><H1
285 CLASS="SECT1"
286 ><A
287 NAME="AEN72"
288 >Why is this better than security = server?</A
289 ></H1
290 ><P
291 >Currently, domain security in Samba doesn't free you from 
292         having to create local Unix users to represent the users attaching 
293         to your server. This means that if domain user <TT
294 CLASS="CONSTANT"
295 >DOM\fred
296         </TT
297 > attaches to your domain security Samba server, there needs 
298         to be a local Unix user fred to represent that user in the Unix 
299         filesystem. This is very similar to the older Samba security mode 
300         <A
301 HREF="smb.conf.5.html#SECURITYEQUALSSERVER"
302 TARGET="_top"
303 >security = server</A
304 >, 
305         where Samba would pass through the authentication request to a Windows 
306         NT server in the same way as a Windows 95 or Windows 98 server would.
307         </P
308 ><P
309 >Please refer to the <A
310 HREF="winbind.html"
311 TARGET="_top"
312 >Winbind 
313         paper</A
314 > for information on a system to automatically
315         assign UNIX uids and gids to Windows NT Domain users and groups.
316         This code is available in development branches only at the moment,
317         but will be moved to release branches soon.</P
318 ><P
319 >The advantage to domain-level security is that the 
320         authentication in domain-level security is passed down the authenticated 
321         RPC channel in exactly the same way that an NT server would do it. This 
322         means Samba servers now participate in domain trust relationships in 
323         exactly the same way NT servers do (i.e., you can add Samba servers into 
324         a resource domain and have the authentication passed on from a resource
325         domain PDC to an account domain PDC.</P
326 ><P
327 >In addition, with <B
328 CLASS="COMMAND"
329 >security = server</B
330 > every Samba 
331         daemon on a server has to keep a connection open to the 
332         authenticating server for as long as that daemon lasts. This can drain 
333         the connection resources on a Microsoft NT server and cause it to run 
334         out of available connections. With <B
335 CLASS="COMMAND"
336 >security = domain</B
337 >, 
338         however, the Samba daemons connect to the PDC/BDC only for as long 
339         as is necessary to authenticate the user, and then drop the connection, 
340         thus conserving PDC connection resources.</P
341 ><P
342 >And finally, acting in the same manner as an NT server 
343         authenticating to a PDC means that as part of the authentication 
344         reply, the Samba server gets the user identification information such 
345         as the user SID, the list of NT groups the user belongs to, etc. All 
346         this information will allow Samba to be extended in the future into 
347         a mode the developers currently call appliance mode. In this mode, 
348         no local Unix users will be necessary, and Samba will generate Unix 
349         uids and gids from the information passed back from the PDC when a 
350         user is authenticated, making a Samba server truly plug and play 
351         in an NT domain environment. Watch for this code soon.</P
352 ><P
353 ><I
354 CLASS="EMPHASIS"
355 >NOTE:</I
356 > Much of the text of this document 
357         was first published in the Web magazine <A
358 HREF="http://www.linuxworld.com"
359 TARGET="_top"
360 >       
361         LinuxWorld</A
362 > as the article <A
363 HREF="http://www.linuxworld.com/linuxworld/lw-1998-10/lw-10-samba.html"
364 TARGET="_top"
365 >Doing 
366         the NIS/NT Samba</A
367 >.</P
368 ></DIV
369 ></DIV
370 ></BODY
371 ></HTML
372 >