preparing for release of 2.2.0-alpha0
[Samba.git] / docs / textdocs / DOMAIN_MEMBER.txt
bloba90960e282f90b5fae90cf03a47e9064c6584969
1 !==
2 !== DOMAIN_MEMBER.txt for Samba release 2.2.0-alpha0 09 Oct 2000
3 !==
5 TITLE INFORMATION: Joining an NT Domain with Samba 2.0 
6 AUTHOR INFORMATION: Jeremy Allison, Samba Team 
7 DATE INFORMATION: 7th October 1999 
9 Table of Contents 
11 Joining an NT Domain with Samba 2.0 
12 ----------------------------------- 
14 In order for a Samba-2 server to join an NT domain, you must first add
15 the NetBIOS name of the Samba server to the NT domain on the PDC using
16 Server Manager for Domains.  This creates the machine account in the
17 domain (PDC) SAM. Note that you should add the Samba server as a "Windows
18 NT Workstation or Server", NOT as a Primary or backup domain controller.
20 Assume you have a Samba-2 server with a NetBIOS name of SERV1 and are
21 joining an NT domain called DOM, which has a PDC with a NetBIOS name
22 of DOMPDC and two backup domain controllers with NetBIOS names DOMBDC1
23 and DOMBDC2.
25 In order to join the domain, first stop all Samba daemons and run the
26 command
28 smbpasswd -j DOM -r DOMPDC
30 as we are joining the domain DOM and the PDC for that domain (the only
31 machine that has write access to the domain SAM database) is DOMPDC. If this is
32 successful you will see the message:
34 smbpasswd: Joined domain DOM.
36 in your terminal window. See the smbpasswd
37 man page for more details.
39 This command goes through the machine account password change
40 protocol, then writes the new (random) machine account password for
41 this Samba server into a file in the same directory in which an
42 smbpasswd file would be stored - normally :
44 /usr/local/samba/private
46 The filename looks like this:
48 <NT DOMAIN NAME>.<Samba Server Name>.mac
50 The .mac suffix stands for machine account password file. So in
51 our example above, the file would be called:
53 DOM.SERV1.mac
55 This file is created and owned by root and is not readable by any
56 other user. It is the key to the domain-level security for your
57 system, and should be treated as carefully as a shadow password file.
59 Now, before restarting the Samba daemons you must edit your
60 smb.conf file to tell Samba it should now
61 use domain security.
63 Change (or add) your 
65 "security ="
67 line in the [global] section of your
68 smb.conf to read:
70 security = domain
72 Next change the 
74 "workgroup ="
76 line in the [global] section to read: 
78 workgroup = DOM
80 as this is the name of the domain we are joining. 
82 You must also have the parameter "encrypt passwords"
83 set to "yes" in order for your users to authenticate to the
84 NT PDC.
86 Finally, add (or modify) a:
88 "password server ="
90 line in the [global] section to read: 
92 password server = DOMPDC DOMBDC1 DOMBDC2
94 These are the primary and backup domain controllers Samba will attempt
95 to contact in order to authenticate users. Samba will try to contact
96 each of these servers in order, so you may want to rearrange this list
97 in order to spread out the authentication load among domain
98 controllers.
100 Alternatively, if you want smbd to automatically determine the
101 list of Domain controllers to use for authentication, you may set this line to be :
103 password server = *
105 This method, which is new in Samba 2.0.6 and above, allows Samba
106 to use exactly the same mechanism that NT does. This method either broadcasts or
107 uses a WINS database in order to find domain controllers to
108 authenticate against.
110 Finally, restart your Samba daemons and get ready for clients to begin
111 using domain security!
113 Why is this better than security = server? 
114 ------------------------------------------ 
116 Currently, domain security in Samba doesn't free you from having to
117 create local Unix users to represent the users attaching to your
118 server. This means that if domain user DOM\fred attaches to your
119 domain security Samba server, there needs to be a local Unix user fred
120 to represent that user in the Unix filesystem. This is very similar to
121 the older Samba security mode "security=server", where Samba would pass
122 through the authentication request to a Windows NT server in the same
123 way as a Windows 95 or Windows 98 server would.
125 The advantage to domain-level security is that the authentication in
126 domain-level security is passed down the authenticated RPC channel in
127 exactly the same way that an NT server would do it. This means Samba
128 servers now participate in domain trust relationships in exactly the
129 same way NT servers do (i.e., you can add Samba servers into a
130 resource domain and have the authentication passed on from a resource
131 domain PDC to an account domain PDC.
133 In addition, with "security=server" every Samba daemon on a
134 server has to keep a connection open to the authenticating server for
135 as long as that daemon lasts. This can drain the connection resources
136 on a Microsoft NT server and cause it to run out of available
137 connections. With "security =domain", however, the Samba
138 daemons connect to the PDC/BDC only for as long as is necessary to
139 authenticate the user, and then drop the connection, thus conserving
140 PDC connection resources.
142 And finally, acting in the same manner as an NT server authenticating
143 to a PDC means that as part of the authentication reply, the Samba
144 server gets the user identification information such as the user SID,
145 the list of NT groups the user belongs to, etc. All this information
146 will allow Samba to be extended in the future into a mode the
147 developers currently call appliance mode. In this mode, no local Unix
148 users will be necessary, and Samba will generate Unix uids and gids
149 from the information passed back from the PDC when a user is
150 authenticated, making a Samba server truly plug and play in an NT
151 domain environment. Watch for this code soon.
153 NOTE: Much of the text of this document was first published in the
154 Web magazine "LinuxWorld" as the article "Doing the NIS/NT Samba".