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 >Assume you have a Samba
2.x server with a NetBIOS name of
39 > and are joining an NT domain called
43 >, which has a PDC with a NetBIOS name
47 > and two backup domain controllers
48 with NetBIOS names
<TT
57 >In order to join the domain, first stop all Samba daemons
58 and run the command:
</P
66 >smbpasswd -j DOM -r DOMPDC
70 >Administrator%password
</I
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)
81 >Administrator%password
</I
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
89 CLASS=
"COMPUTEROUTPUT"
90 >smbpasswd: Joined domain DOM.
</TT
94 >in your terminal window. See the
<A
95 HREF=
"smbpasswd.8.html"
98 > man page for more details.
</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
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
112 >/usr/local/samba/private
</TT
115 >In Samba
2.0.x, the filename looks like this:
</P
122 ><NT DOMAIN NAME
></I
136 > suffix stands for machine account
137 password file. So in our example above, the file would be called:
</P
144 >In Samba
2.2, this file has been replaced with a TDB
145 (Trivial Database) file named
<TT
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
156 >Now, before restarting the Samba daemons you must
158 HREF=
"smb.conf.5.html"
165 > file to tell Samba it should now use domain security.
</P
167 >Change (or add) your
<A
168 HREF=
"smb.conf.5.html#SECURITY"
176 > line in the [global] section
177 of your smb.conf to read:
</P
181 >security = domain
</B
185 HREF=
"smb.conf.5.html#WORKGROUP"
193 > line in the [global] section to read:
</P
200 >as this is the name of the domain we are joining.
</P
202 >You must also have the parameter
<A
203 HREF=
"smb.conf.5.html#ENCRYPTPASSWORDS"
208 >encrypt passwords
</I
215 > in order for your users to authenticate to the NT PDC.
</P
217 >Finally, add (or modify) a
<A
218 HREF=
"smb.conf.5.html#PASSWORDSERVER"
223 >password server =
</I
226 > line in the [global]
231 >password server = DOMPDC DOMBDC1 DOMBDC2
</B
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
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
246 >password server = *
</B
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
254 >Finally, restart your Samba daemons and get ready for
255 clients to begin using domain security!
</P
263 >Samba and Windows
2000 Domains
</A
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
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
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
288 >Why is this better than security = server?
</A
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
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
301 HREF=
"smb.conf.5.html#SECURITYEQUALSSERVER"
303 >security = server
</A
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.
309 >Please refer to the
<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
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
327 >In addition, with
<B
329 >security = server
</B
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
336 >security = domain
</B
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
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
356 > Much of the text of this document
357 was first published in the Web magazine
<A
358 HREF=
"http://www.linuxworld.com"
363 HREF=
"http://www.linuxworld.com/linuxworld/lw-1998-10/lw-10-samba.html"