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