* merge fixes for SGML syntax errors (does no one ever regenerate the docs?)
[gd/samba-autobuild/.git] / docs / htmldocs / domain-security.html
1 <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
2 <HTML
3 ><HEAD
4 ><TITLE
5 >Samba as a NT4 domain member</TITLE
6 ><META
7 NAME="GENERATOR"
8 CONTENT="Modular DocBook HTML Stylesheet Version 1.76b+
9 "><LINK
10 REL="HOME"
11 TITLE="SAMBA Project Documentation"
12 HREF="samba-howto-collection.html"><LINK
13 REL="UP"
14 TITLE="Type of installation"
15 HREF="type.html"><LINK
16 REL="PREVIOUS"
17 TITLE="Samba as a ADS domain member"
18 HREF="ads.html"><LINK
19 REL="NEXT"
20 TITLE="Optional configuration"
21 HREF="optional.html"></HEAD
22 ><BODY
23 CLASS="CHAPTER"
24 BGCOLOR="#FFFFFF"
25 TEXT="#000000"
26 LINK="#0000FF"
27 VLINK="#840084"
28 ALINK="#0000FF"
29 ><DIV
30 CLASS="NAVHEADER"
31 ><TABLE
32 SUMMARY="Header navigation table"
33 WIDTH="100%"
34 BORDER="0"
35 CELLPADDING="0"
36 CELLSPACING="0"
37 ><TR
38 ><TH
39 COLSPAN="3"
40 ALIGN="center"
41 >SAMBA Project Documentation</TH
42 ></TR
43 ><TR
44 ><TD
45 WIDTH="10%"
46 ALIGN="left"
47 VALIGN="bottom"
48 ><A
49 HREF="ads.html"
50 ACCESSKEY="P"
51 >Prev</A
52 ></TD
53 ><TD
54 WIDTH="80%"
55 ALIGN="center"
56 VALIGN="bottom"
57 ></TD
58 ><TD
59 WIDTH="10%"
60 ALIGN="right"
61 VALIGN="bottom"
62 ><A
63 HREF="optional.html"
64 ACCESSKEY="N"
65 >Next</A
66 ></TD
67 ></TR
68 ></TABLE
69 ><HR
70 ALIGN="LEFT"
71 WIDTH="100%"></DIV
72 ><DIV
73 CLASS="CHAPTER"
74 ><H1
75 ><A
76 NAME="DOMAIN-SECURITY">Chapter 9. Samba as a NT4 domain member</H1
77 ><DIV
78 CLASS="SECT1"
79 ><H1
80 CLASS="SECT1"
81 ><A
82 NAME="AEN1273">9.1. Joining an NT Domain with Samba 2.2</H1
83 ><P
84 >Assume you have a Samba 2.x server with a NetBIOS name of 
85         <TT
86 CLASS="CONSTANT"
87 >SERV1</TT
88 > and are joining an NT domain called
89         <TT
90 CLASS="CONSTANT"
91 >DOM</TT
92 >, which has a PDC with a NetBIOS name
93         of <TT
94 CLASS="CONSTANT"
95 >DOMPDC</TT
96 > and two backup domain controllers 
97         with NetBIOS names <TT
98 CLASS="CONSTANT"
99 >DOMBDC1</TT
100 > and <TT
101 CLASS="CONSTANT"
102 >DOMBDC2
103         </TT
104 >.</P
105 ><P
106 >In order to join the domain, first stop all Samba daemons 
107         and run the command:</P
108 ><P
109 ><TT
110 CLASS="PROMPT"
111 >root# </TT
112 ><TT
113 CLASS="USERINPUT"
114 ><B
115 >smbpasswd -j DOM -r DOMPDC
116         -U<TT
117 CLASS="REPLACEABLE"
118 ><I
119 >Administrator%password</I
120 ></TT
121 ></B
122 ></TT
123 ></P
124 ><P
125 >as we are joining the domain DOM and the PDC for that domain 
126         (the only machine that has write access to the domain SAM database) 
127         is DOMPDC. The <TT
128 CLASS="REPLACEABLE"
129 ><I
130 >Administrator%password</I
131 ></TT
132 > is 
133         the login name and password for an account which has the necessary 
134         privilege to add machines to the domain.  If this is successful 
135         you will see the message:</P
136 ><P
137 ><TT
138 CLASS="COMPUTEROUTPUT"
139 >smbpasswd: Joined domain DOM.</TT
140 >
141         </P
142 ><P
143 >in your terminal window. See the <A
144 HREF="smbpasswd.8.html"
145 TARGET="_top"
146 >       smbpasswd(8)</A
147 > man page for more details.</P
148 ><P
149 >There is existing development code to join a domain
150         without having to create the machine trust account on the PDC
151         beforehand.  This code will hopefully be available soon
152         in release branches as well.</P
153 ><P
154 >This command goes through the machine account password 
155         change protocol, then writes the new (random) machine account 
156         password for this Samba server into a file in the same directory 
157         in which an smbpasswd file would be stored - normally :</P
158 ><P
159 ><TT
160 CLASS="FILENAME"
161 >/usr/local/samba/private</TT
162 ></P
163 ><P
164 >In Samba 2.0.x, the filename looks like this:</P
165 ><P
166 ><TT
167 CLASS="FILENAME"
168 ><TT
169 CLASS="REPLACEABLE"
170 ><I
171 >&lt;NT DOMAIN NAME&gt;</I
172 ></TT
173 >.<TT
174 CLASS="REPLACEABLE"
175 ><I
176 >&lt;Samba 
177         Server Name&gt;</I
178 ></TT
179 >.mac</TT
180 ></P
181 ><P
182 >The <TT
183 CLASS="FILENAME"
184 >.mac</TT
185 > suffix stands for machine account 
186         password file. So in our example above, the file would be called:</P
187 ><P
188 ><TT
189 CLASS="FILENAME"
190 >DOM.SERV1.mac</TT
191 ></P
192 ><P
193 >In Samba 2.2, this file has been replaced with a TDB 
194         (Trivial Database) file named <TT
195 CLASS="FILENAME"
196 >secrets.tdb</TT
197 >.
198         </P
199 ><P
200 >This file is created and owned by root and is not 
201         readable by any other user. It is the key to the domain-level 
202         security for your system, and should be treated as carefully 
203         as a shadow password file.</P
204 ><P
205 >Now, before restarting the Samba daemons you must 
206         edit your <A
207 HREF="smb.conf.5.html"
208 TARGET="_top"
209 ><TT
210 CLASS="FILENAME"
211 >smb.conf(5)</TT
212 >
213         </A
214 > file to tell Samba it should now use domain security.</P
215 ><P
216 >Change (or add) your <A
217 HREF="smb.conf.5.html#SECURITY"
218 TARGET="_top"
219 >       <TT
220 CLASS="PARAMETER"
221 ><I
222 >security =</I
223 ></TT
224 ></A
225 > line in the [global] section 
226         of your smb.conf to read:</P
227 ><P
228 ><B
229 CLASS="COMMAND"
230 >security = domain</B
231 ></P
232 ><P
233 >Next change the <A
234 HREF="smb.conf.5.html#WORKGROUP"
235 TARGET="_top"
236 ><TT
237 CLASS="PARAMETER"
238 ><I
239 >       workgroup =</I
240 ></TT
241 ></A
242 > line in the [global] section to read: </P
243 ><P
244 ><B
245 CLASS="COMMAND"
246 >workgroup = DOM</B
247 ></P
248 ><P
249 >as this is the name of the domain we are joining. </P
250 ><P
251 >You must also have the parameter <A
252 HREF="smb.conf.5.html#ENCRYPTPASSWORDS"
253 TARGET="_top"
254 >       <TT
255 CLASS="PARAMETER"
256 ><I
257 >encrypt passwords</I
258 ></TT
259 ></A
260 > set to <TT
261 CLASS="CONSTANT"
262 >yes
263         </TT
264 > in order for your users to authenticate to the NT PDC.</P
265 ><P
266 >Finally, add (or modify) a <A
267 HREF="smb.conf.5.html#PASSWORDSERVER"
268 TARGET="_top"
269 >       <TT
270 CLASS="PARAMETER"
271 ><I
272 >password server =</I
273 ></TT
274 ></A
275 > line in the [global]
276         section to read: </P
277 ><P
278 ><B
279 CLASS="COMMAND"
280 >password server = DOMPDC DOMBDC1 DOMBDC2</B
281 ></P
282 ><P
283 >These are the primary and backup domain controllers Samba 
284         will attempt to contact in order to authenticate users. Samba will 
285         try to contact each of these servers in order, so you may want to 
286         rearrange this list in order to spread out the authentication load 
287         among domain controllers.</P
288 ><P
289 >Alternatively, if you want smbd to automatically determine 
290         the list of Domain controllers to use for authentication, you may 
291         set this line to be :</P
292 ><P
293 ><B
294 CLASS="COMMAND"
295 >password server = *</B
296 ></P
297 ><P
298 >This method, which was introduced in Samba 2.0.6, 
299         allows Samba to use exactly the same mechanism that NT does. This 
300         method either broadcasts or uses a WINS database in order to
301         find domain controllers to authenticate against.</P
302 ><P
303 >Finally, restart your Samba daemons and get ready for 
304         clients to begin using domain security!</P
305 ></DIV
306 ><DIV
307 CLASS="SECT1"
308 ><H1
309 CLASS="SECT1"
310 ><A
311 NAME="AEN1337">9.2. Samba and Windows 2000 Domains</H1
312 ><P
313 >Many people have asked regarding the state of Samba's ability to participate in
314 a Windows 2000 Domain.  Samba 3.0 is able to act as a member server of a Windows
315 2000 domain operating in mixed or native mode.</P
316 ><P
317 >There is much confusion between the circumstances that require a "mixed" mode
318 Win2k DC and a when this host can be switched to "native" mode.  A "mixed" mode
319 Win2k domain controller is only needed if Windows NT BDCs must exist in the same
320 domain.  By default, a Win2k DC in "native" mode will still support
321 NetBIOS and NTLMv1 for authentication of legacy clients such as Windows 9x and 
322 NT 4.0.  Samba has the same requirements as a Windows NT 4.0 member server.</P
323 ><P
324 >The steps for adding a Samba 2.2 host to a Win2k domain are the same as those
325 for adding a Samba server to a Windows NT 4.0 domain. The only exception is that 
326 the "Server Manager" from NT 4 has been replaced by the "Active Directory Users and 
327 Computers" MMC (Microsoft Management Console) plugin.</P
328 ></DIV
329 ><DIV
330 CLASS="SECT1"
331 ><H1
332 CLASS="SECT1"
333 ><A
334 NAME="AEN1342">9.3. Why is this better than security = server?</H1
335 ><P
336 >Currently, domain security in Samba doesn't free you from 
337         having to create local Unix users to represent the users attaching 
338         to your server. This means that if domain user <TT
339 CLASS="CONSTANT"
340 >DOM\fred
341         </TT
342 > attaches to your domain security Samba server, there needs 
343         to be a local Unix user fred to represent that user in the Unix 
344         filesystem. This is very similar to the older Samba security mode 
345         <A
346 HREF="smb.conf.5.html#SECURITYEQUALSSERVER"
347 TARGET="_top"
348 >security = server</A
349 >, 
350         where Samba would pass through the authentication request to a Windows 
351         NT server in the same way as a Windows 95 or Windows 98 server would.
352         </P
353 ><P
354 >Please refer to the <A
355 HREF="winbind.html"
356 TARGET="_top"
357 >Winbind 
358         paper</A
359 > for information on a system to automatically
360         assign UNIX uids and gids to Windows NT Domain users and groups.
361         This code is available in development branches only at the moment,
362         but will be moved to release branches soon.</P
363 ><P
364 >The advantage to domain-level security is that the 
365         authentication in domain-level security is passed down the authenticated 
366         RPC channel in exactly the same way that an NT server would do it. This 
367         means Samba servers now participate in domain trust relationships in 
368         exactly the same way NT servers do (i.e., you can add Samba servers into 
369         a resource domain and have the authentication passed on from a resource
370         domain PDC to an account domain PDC.</P
371 ><P
372 >In addition, with <B
373 CLASS="COMMAND"
374 >security = server</B
375 > every Samba 
376         daemon on a server has to keep a connection open to the 
377         authenticating server for as long as that daemon lasts. This can drain 
378         the connection resources on a Microsoft NT server and cause it to run 
379         out of available connections. With <B
380 CLASS="COMMAND"
381 >security = domain</B
382 >, 
383         however, the Samba daemons connect to the PDC/BDC only for as long 
384         as is necessary to authenticate the user, and then drop the connection, 
385         thus conserving PDC connection resources.</P
386 ><P
387 >And finally, acting in the same manner as an NT server 
388         authenticating to a PDC means that as part of the authentication 
389         reply, the Samba server gets the user identification information such 
390         as the user SID, the list of NT groups the user belongs to, etc. All 
391         this information will allow Samba to be extended in the future into 
392         a mode the developers currently call appliance mode. In this mode, 
393         no local Unix users will be necessary, and Samba will generate Unix 
394         uids and gids from the information passed back from the PDC when a 
395         user is authenticated, making a Samba server truly plug and play 
396         in an NT domain environment. Watch for this code soon.</P
397 ><P
398 ><SPAN
399 CLASS="emphasis"
400 ><I
401 CLASS="EMPHASIS"
402 >NOTE:</I
403 ></SPAN
404 > Much of the text of this document 
405         was first published in the Web magazine <A
406 HREF="http://www.linuxworld.com"
407 TARGET="_top"
408 >       
409         LinuxWorld</A
410 > as the article <A
411 HREF="http://www.linuxworld.com/linuxworld/lw-1998-10/lw-10-samba.html"
412 TARGET="_top"
413 >Doing 
414         the NIS/NT Samba</A
415 >.</P
416 ></DIV
417 ></DIV
418 ><DIV
419 CLASS="NAVFOOTER"
420 ><HR
421 ALIGN="LEFT"
422 WIDTH="100%"><TABLE
423 SUMMARY="Footer navigation table"
424 WIDTH="100%"
425 BORDER="0"
426 CELLPADDING="0"
427 CELLSPACING="0"
428 ><TR
429 ><TD
430 WIDTH="33%"
431 ALIGN="left"
432 VALIGN="top"
433 ><A
434 HREF="ads.html"
435 ACCESSKEY="P"
436 >Prev</A
437 ></TD
438 ><TD
439 WIDTH="34%"
440 ALIGN="center"
441 VALIGN="top"
442 ><A
443 HREF="samba-howto-collection.html"
444 ACCESSKEY="H"
445 >Home</A
446 ></TD
447 ><TD
448 WIDTH="33%"
449 ALIGN="right"
450 VALIGN="top"
451 ><A
452 HREF="optional.html"
453 ACCESSKEY="N"
454 >Next</A
455 ></TD
456 ></TR
457 ><TR
458 ><TD
459 WIDTH="33%"
460 ALIGN="left"
461 VALIGN="top"
462 >Samba as a ADS domain member</TD
463 ><TD
464 WIDTH="34%"
465 ALIGN="center"
466 VALIGN="top"
467 ><A
468 HREF="type.html"
469 ACCESSKEY="U"
470 >Up</A
471 ></TD
472 ><TD
473 WIDTH="33%"
474 ALIGN="right"
475 VALIGN="top"
476 >Optional configuration</TD
477 ></TR
478 ></TABLE
479 ></DIV
480 ></BODY
481 ></HTML
482 >