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