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