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