first pass at updating head branch to be to be the same as the SAMBA_2_0 branch
[sfrench/samba-autobuild/.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.org">
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>7th October 1999</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. Note that you should add the Samba server as a "Windows
27 NT Workstation or Server", <em>NOT</em> as a Primary or backup domain controller.
28 <p><br>Assume you have a Samba-2 server with a NetBIOS name of <code>SERV1</code> and are
29 joining an NT domain called <code>DOM</code>, which has a PDC with a NetBIOS name
30 of <code>DOMPDC</code> and two backup domain controllers with NetBIOS names <code>DOMBDC1</code>
31 and <code>DOMBDC2</code>.
32 <p><br>In order to join the domain, first stop all Samba daemons and run the
33 command
34 <p><br><code>smbpasswd -j DOM -r DOMPDC</code>
35 <p><br>as we are joining the domain DOM and the PDC for that domain (the only
36 machine that has write access to the domain SAM database). If this is
37 successful you will see the message:
38 <p><br><code>smbpasswd: Joined domain DOM.</code>
39 <p><br>in your terminal window. See the <a href="smbpasswd.8.html"><strong>smbpasswd</strong></a>
40 man page for more details.
41 <p><br>This command goes through the machine account password change
42 protocol, then writes the new (random) machine account password for
43 this Samba server into the a file in the same directory in which an
44 smbpasswd file would be stored (normally :
45 <p><br><code>/usr/local/samba/private</code>
46 <p><br>The filename looks like this:
47 <p><br><code>&lt;NT DOMAIN NAME&gt;.&lt;Samba Server Name&gt;.mac</code>
48 <p><br>The <code>.mac</code> suffix stands for machine account password file. So in
49 our example above, the file would be called:
50 <p><br><code>DOM.SERV1.mac</code>
51 <p><br>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 <p><br>Now, before restarting the Samba daemons you must edit your
55 <a href="smb.conf.5.html"><strong>smb.conf</strong></a> file to tell Samba it should now
56 use domain security.
57 <p><br>Change (or add) your 
58 <p><br><a href="smb.conf.5.html#security"><strong>"security ="</strong></a>
59 <p><br>line in the <a href="smb.conf.5.html#global"><strong>[global]</strong></a> section of your
60 <a href="smb.conf.5.html"><strong>smb.conf</strong></a> to read:
61 <p><br><code>security = domain</code>
62 <p><br>Next change the 
63 <p><br><a href="smb.conf.5.html#workgroup"><strong>"workgroup ="</strong></a>
64 <p><br>line in the <a href="smb.conf.5.html#global"><strong>[global]</strong></a> section to read: 
65 <p><br><code>workgroup = DOM</code>
66 <p><br>as this is the name of the domain we are joining. 
67 <p><br>You must also have the parameter <a href="smb.conf.5.html#encryptpasswords"><strong>"encrypt passwords"</strong></a>
68 set to <code>"yes"</code> in order for your users to authenticate to the
69 NT PDC.
70 <p><br>Finally, add (or modify) a:
71 <p><br><a href="smb.conf.5.html#passwordserver"><strong>"password server ="</strong></a>
72 <p><br>line in the <a href="smb.conf.5.html#global"><strong>[global]</strong></a> section to read: 
73 <p><br><code>password server = DOMPDC DOMBDC1 DOMBDC2</code>
74 <p><br>These are the primary and backup domain controllers Samba will attempt
75 to contact in order to authenticate users. Samba will try to contact
76 each of these servers in order, so you may want to rearrange this list
77 in order to spread out the authentication load among domain
78 controllers.
79 <p><br>Alternatively, if you want smbd to automatically determine the
80 list of Domain controllers to use for authentication, you may set this line to be :
81 <p><br><code>password server = *</code>
82 <p><br>This method, which is new in Samba 2.0.6 and above, allows Samba
83 to use exactly the same mechanism that NT does. This method either broadcasts or
84 uses a WINS database in order to find domain controllers to
85 authenticate against.
86 <p><br>Finally, restart your Samba daemons and get ready for clients to begin
87 using domain security!
88 <p><br><center>Why is this better than security = server? </center>
89 <center>------------------------------------------ </center>
90 <p><br>Currently, domain security in Samba doesn't free you from having to
91 create local Unix users to represent the users attaching to your
92 server. This means that if domain user <code>DOM\fred</code> attaches to your
93 domain security Samba server, there needs to be a local Unix user fred
94 to represent that user in the Unix filesystem. This is very similar to
95 the older Samba security mode <a href="smb.conf.5.html#securityequalserver"><strong>"security=server"</strong></a>, where Samba would pass
96 through the authentication request to a Windows NT server in the same
97 way as a Windows 95 or Windows 98 server would.
98 <p><br>The advantage to domain-level security is that the authentication in
99 domain-level security is passed down the authenticated RPC channel in
100 exactly the same way that an NT server would do it. This means Samba
101 servers now participate in domain trust relationships in exactly the
102 same way NT servers do (i.e., you can add Samba servers into a
103 resource domain and have the authentication passed on from a resource
104 domain PDC to an account domain PDC.
105 <p><br>In addition, with <a href="smb.conf.5.html#securityequalserver"><strong>"security=server"</strong></a> every Samba daemon on a
106 server has to keep a connection open to the authenticating server for
107 as long as that daemon lasts. This can drain the connection resources
108 on a Microsoft NT server and cause it to run out of available
109 connections. With <a href="smb.conf.5.html#securityequaldomain"><strong>"security =domain"</strong></a>, however, the Samba
110 daemons connect to the PDC/BDC only for as long as is necessary to
111 authenticate the user, and then drop the connection, thus conserving
112 PDC connection resources.
113 <p><br>And finally, acting in the same manner as an NT server authenticating
114 to a PDC means that as part of the authentication reply, the Samba
115 server gets the user identification information such as the user SID,
116 the list of NT groups the user belongs to, etc. All this information
117 will allow Samba to be extended in the future into a mode the
118 developers currently call appliance mode. In this mode, no local Unix
119 users will be necessary, and Samba will generate Unix uids and gids
120 from the information passed back from the PDC when a user is
121 authenticated, making a Samba server truly plug and play in an NT
122 domain environment. Watch for this code soon.
123 <p><br><em>NOTE:</em> Much of the text of this document was first published in the
124 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>.
125 </body>
126 </html>