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