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