4 >security = domain in Samba 2.x</TITLE
7 CONTENT="Modular DocBook HTML Stylesheet Version 1.57"></HEAD
22 NAME="DOMAIN-SECURITY"
23 >security = domain in Samba 2.x</A
32 >Joining an NT Domain with Samba 2.2</A
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",
43 > as a Primary or backup domain controller.</P
45 >Assume you have a Samba-2 server with a NetBIOS name of
49 > and are joining an NT domain called
53 >, which has a PDC with a NetBIOS name
57 > and two backup domain controllers
58 with NetBIOS names <TT
67 >In order to join the domain, first stop all Samba daemons
68 and run the command:</P
76 >smbpasswd -j DOM -r DOMPDC
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
86 CLASS="COMPUTEROUTPUT"
87 >smbpasswd: Joined domain DOM.</TT
91 >in your terminal window. See the <A
92 HREF="smbpasswd.8.html"
95 > man page for more details.</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
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
109 >/usr/local/samba/private</TT
112 >In Samba 2.0.x, the filename looks like this:</P
119 ><NT DOMAIN NAME></I
133 > suffix stands for machine account
134 password file. So in our example above, the file would be called:</P
141 >In Samba 2.2, this file has been replaced with a TDB
142 (Trivial Database) file named <TT
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
153 >Now, before restarting the Samba daemons you must
155 HREF="smb.conf.5.html"
162 > file to tell Samba it should now use domain security.</P
164 >Change (or add) your <A
165 HREF="smb.conf.5.html#SECURITY"
173 > line in the [global] section
174 of your smb.conf to read:</P
178 >security = domain</B
182 HREF="smb.conf.5.html#WORKGROUP"
190 > line in the [global] section to read: </P
197 >as this is the name of the domain we are joining. </P
199 >You must also have the parameter <A
200 HREF="smb.conf.5.html#ENCRYPTPASSWORDS"
205 >encrypt passwords</I
212 > in order for your users to authenticate to the NT PDC.</P
214 >Finally, add (or modify) a <A
215 HREF="smb.conf.5.html#PASSWORDSERVER"
220 >password server =</I
223 > line in the [global]
228 >password server = DOMPDC DOMBDC1 DOMBDC2</B
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
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
243 >password server = *</B
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
251 >Finally, restart your Samba daemons and get ready for
252 clients to begin using domain security!</P
260 >Samba and Windows 2000 Domains</A
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
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
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
285 >Why is this better than security = server?</A
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
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
298 HREF="smb.conf.5.html#SECURITYEQUALSSERVER"
300 >security = server</A
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.
306 >Please refer to the <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
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
324 >In addition, with <B
326 >security = server</B
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
333 >security = domain</B
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
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
353 > Much of the text of this document
354 was first published in the Web magazine <A
355 HREF="http://www.linuxworld.com"
360 HREF="http://www.linuxworld.com/linuxworld/lw-1998-10/lw-10-samba.html"