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