Test harness stuff for compiling things.
[samba.git] / docs / manpages / winbindd.8
1 .TH "winbindd " "8" "13 Jun 2000" "Samba" "SAMBA" 
2 .PP 
3 .SH "NAME" 
4 winbindd \- Name Service Switch daemon for resolving names from NT servers
5 .PP 
6 .SH "SYNOPSIS" 
7 .PP 
8 \fBwinbindd\fP [-d debuglevel] [-i]
9 .PP 
10 .SH "DESCRIPTION" 
11 .PP 
12 This program is part of the \fBSamba\fP suite version 3\&.0 and describes
13 functionality not yet implemented in the main version of Samba\&.
14 .PP 
15 \fBwinbindd\fP is a daemon that provides a service for the Name Service
16 Switch capability that is present in most modern C libraries\&.  The Name
17 Service Switch allows user and system information to be obtained from
18 different databases services such as NIS or DNS\&.  The exact behaviour can
19 be configured throught the \f(CW/etc/nsswitch\&.conf\fP file\&.  Users and groups
20 are allocated as they are resolved to a range of user and group ids
21 specified by the administrator of the Samba system\&.  
22 .PP 
23 The service provided by \fBwinbindd\fP is called `winbind\' and can be
24 used to resolve user and group information from a Windows NT server\&.
25 The service can also provide authentication services via an associated
26 PAM module\&.
27 .PP 
28 The following nsswitch databases are implemented by the \fBwinbindd\fP
29 service:
30 .PP 
31 .IP 
32 .IP "passwd" 
33 .IP 
34 User information traditionally stored in the \fBpasswd(5)\fP file and used by
35 \fBgetpwent(3)\fP functions\&.
36 .IP 
37 .IP "group" 
38 .IP 
39 Group information traditionally stored in the \fBgroup(5)\fP file and used by
40 \fBgetgrent(3)\fP functions\&.
41 .IP 
42 .PP 
43 For example, the following simple configuration in the
44 \f(CW/etc/nsswitch\&.conf\fP file can be used to initially resolve user and group
45 information from \f(CW/etc/passwd\fP and \f(CW/etc/group\fP and then from the
46 Windows NT server\&.
47 .PP 
48
49 .nf 
50  
51
52   passwd:         files winbind
53   group:          files winbind
54
55 .fi 
56  
57
58 .PP 
59 .SH "OPTIONS" 
60 .PP 
61 The following options are available to the \fBwinbindd\fP daemon:
62 .PP 
63 .IP 
64 .IP "\fB-d debuglevel\fP" 
65 Sets the debuglevel to an integer between 0 and 100\&. 0 is for no debugging
66 and 100 is for reams and reams\&. To submit a bug report to the Samba Team,
67 use debug level 100 (see \fBBUGS\&.txt\fP)\&.  
68 .IP 
69 .IP "\fB-i\fP" 
70 Tells winbindd to not become a daemon and detach from the current terminal\&.
71 This option is used by developers when interactive debugging of winbindd is
72 required\&.
73 .IP 
74 .PP 
75 .SH "NAME AND ID RESOLUTION" 
76 .PP 
77 Users and groups on a Windows NT server are assigned a relative id (rid)
78 which is unique for the domain when the user or group is created\&.  To
79 convert the Windows NT user or group into a unix user or group, a mapping
80 between rids and unix user and group ids is required\&.  This is one of the
81 jobs that \fBwinbindd\fP performs\&.
82 .PP 
83 As \fBwinbindd\fP users and groups are resolved from a server, user and group
84 ids are allocated from a specified range\&.  This is done on a first come,
85 first served basis, although all existing users and groups will be mapped
86 as soon as a client performs a user or group enumeration command\&.  The
87 allocated unix ids are stored in a database file under the Samba lock
88 directory and will be remembered\&.
89 .PP 
90 WARNING: The rid to unix id database is the only location where the user
91 and group mappings are stored by \fBwinbindd\fP\&.  If this file is deleted or
92 corrupted, there is no way for \fBwinbindd\fP to determine which user and
93 group ids correspond to Windows NT user and group rids\&.
94 .PP 
95 .SH "CONFIGURATION" 
96 .PP 
97 Configuration of the \fBwinbindd\fP daemon is done through configuration
98 parameters in the \fBsmb\&.conf\fP file\&.  All parameters
99 should be specified in the [global] section of
100 \fBsmb\&.conf\fP\&.
101 .PP 
102 .IP 
103 .IP "winbind separator" 
104 .IP 
105 The winbind separator option allows you to specify how NT domain names
106 and user names are combined into unix user names when presented to
107 users\&. By default winbind will use the traditional \e separator so
108 that the unix user names look like DOMAIN\eusername\&. In some cases
109 this separator character may cause problems as the \e character has
110 special meaning in unix shells\&. In that case you can use the winbind
111 separator option to specify an alternative sepataror character\&. Good
112 alternatives may be / (although that conflicts with the unix directory
113 separator) or a + character\&. The + character appears to be the best
114 choice for 100% compatibility with existing unix utilities, but may be
115 an aesthetically bad choice depending on your taste\&.
116 .IP 
117 \fBDefault:\fP
118 \f(CW     winbind separator = \e\fP
119 .IP 
120 \fBExample:\fP
121 \f(CW     winbind separator = +\fP
122 .IP 
123 .IP "winbind uid" 
124 .IP 
125 The winbind uid parameter specifies the range of user ids that are
126 allocated by the \fBwinbindd\fP daemon\&.  This range of
127 ids should have no existing local or nis users within it as strange
128 conflicts can occur otherwise\&.
129 .IP 
130 \fBDefault:\fP
131 \f(CW     winbind uid = <empty string>\fP
132 .IP 
133 \fBExample:\fP
134 \f(CW     winbind uid = 10000-20000\fP
135 .IP 
136 .IP "winbind gid" 
137 .IP 
138 The winbind gid parameter specifies the range of group ids that are
139 allocated by the \fBwinbindd\fP daemon\&.  This range of group ids should have
140 no existing local or nis groups within it as strange conflicts can occur
141 otherwise\&.
142 .IP 
143 \fBDefault:\fP
144 \f(CW     winbind gid = <empty string>\fP
145 .IP 
146 \fBExample:\fP
147 \f(CW     winbind gid = 10000-20000\fP
148 .IP 
149 .IP "winbind cache time" 
150 .IP 
151 This parameter specifies the number of seconds the \fBwinbindd\fP daemon will
152 cache user and group information before querying a Windows NT server
153 again\&. When a item in the cache is older than this time winbindd will ask
154 the domain controller for the sequence number of the servers account
155 database\&. If the sequence number has not changed then the cached item is
156 marked as valid for a further "winbind cache time" seconds\&.  Otherwise the
157 item is fetched from the server\&. This means that as long as the account
158 database is not actively changing winbindd will only have to send one
159 sequence number query packet every "winbind cache time" seconds\&.
160 .IP 
161 \fBDefault:\fP
162 \f(CW     winbind cache time = 15\fP
163 .IP 
164 .IP "template homedir" 
165 .IP 
166 When filling out the user information for a Windows NT user, the
167 \fBwinbindd\fP daemon uses this parameter to fill in the home directory for
168 that user\&.  If the string \f(CW%D\fP is present it is substituted with the
169 user\'s Windows NT domain name\&.  If the string \f(CW%U\fP is present it is
170 substituted with the user\'s Windows NT user name\&.
171 .IP 
172 \fBDefault:\fP
173 \f(CW     template homedir = /home/%D/%U\fP
174 .IP 
175 .IP "template shell" 
176 .IP 
177 When filling out the user information for a Windows NT user, the
178 \fBwinbindd\fP daemon uses this parameter to fill in the shell for that user\&.
179 .IP 
180 \fBDefault:\fP
181 \f(CW     template shell = /bin/false\fP
182 .IP 
183 .PP 
184 .SH "EXAMPLE SETUP" 
185 .PP 
186 To setup winbindd for user and group lookups plus authentication from
187 a domain controller use something like the following setup\&. This was
188 tested on a RedHat 6\&.2 Linux box\&.
189 .PP 
190 In \f(CW/etc/nsswitch\&.conf\fP put the following:
191
192 .nf 
193  
194
195    passwd:     files winbind
196    group:      files winbind
197
198 .fi 
199  
200
201 .PP 
202 In \f(CW/etc/pam\&.d/*\fP replace the \f(CWauth\fP lines with something like this:
203
204 .nf 
205  
206
207         auth       required     /lib/security/pam_securetty\&.so
208         auth       required     /lib/security/pam_nologin\&.so
209         auth       sufficient   /lib/security/pam_winbind\&.so
210         auth       required     /lib/security/pam_pwdb\&.so use_first_pass shadow nullok
211
212 .fi 
213  
214
215 .PP 
216 Note in particular the use of the \f(CWsufficient\fP keyword and the
217 \f(CWuse_first_pass\fP keyword\&.
218 .PP 
219 Now replace the account lines with this:
220
221 .nf 
222  
223
224         account    required     /lib/security/pam_winbind\&.so
225
226 .fi 
227  
228
229 .PP 
230 The next step is to join the domain\&. To do that use the samedit
231 program like this:
232
233 .nf 
234  
235
236         samedit -S \'*\' -W DOMAIN -UAdministrator
237
238 .fi 
239  
240
241 .PP 
242 Then within samedit run the command:
243
244 .nf 
245  
246
247         createuser MACHINE$ -j DOMAIN -L
248
249 .fi 
250  
251
252 .PP 
253 This assumes your domain is called \f(CWDOMAIN\fP and your Samba workstation
254 is called \f(CWMACHINE\fP\&.
255 .PP 
256 Next copy \f(CWlibnss_winbind\&.so\&.2\fP to \f(CW/lib\fP and \f(CWpam_winbind\&.so\fP to
257 \f(CW/lib/security\fP\&.
258 .PP 
259 Finally, setup a smb\&.conf containing directives like the following:
260
261 .nf 
262  
263
264   [global]
265         winbind separator = +
266         winbind cache time = 10
267         template shell = /bin/bash
268         template homedir = /home/%D/%U
269         winbind uid = 10000-20000
270         winbind gid = 10000-20000
271         workgroup = DOMAIN
272         security = domain
273         password server = *
274
275 .fi 
276  
277
278 .PP 
279 Now start winbindd and you should find that your user and group
280 database is expanded to include your NT users and groups, and that you
281 can login to your unix box as a domain user, using the \f(CWDOMAIN+user\fP
282 syntax for the username\&. You may wish to use the commands "getent
283 passwd" and "getent group" to confirm the correct operation of
284 winbindd\&. 
285 .PP 
286 .SH "NOTES" 
287 .PP 
288 The following notes are useful when configuring and running \fBwinbindd\fP:
289 .PP 
290 .IP 
291 .IP "" 
292 \fBnmbd\fP must be running on the local machine for
293 \fBwinbindd\fP to work\&.
294 .IP 
295 .IP "" 
296 Client processes resolving names through the \fBwinbindd\fP nsswitch module
297 read an environment variable named \f(CWWINBINDD_DOMAIN\fP\&.  If this variable
298 contains a comma separated list of Windows NT domain names, then winbindd
299 will only resolve users and groups within those Windows NT domains\&.
300 .IP 
301 .IP "" 
302 PAM is really easy to misconfigure\&.  Make sure you know what you are doing
303 when modifying PAM configuration files\&.  It is possible to set up PAM
304 such that you can no longer log into your system\&.
305 .IP 
306 .IP "" 
307 If more than one UNIX machine is running \fBwinbindd\fP, then in general the
308 user and groups ids allocated by \fBwinbindd\fP will not be the same\&.  The
309 user and group ids will only be valid for the local machine\&.  
310 .IP 
311 .IP "" 
312 If the the Windows NT RID to UNIX user and group id mapping file
313 is damaged or destroyed then the mappings will be lost\&.
314 .IP 
315 .PP 
316 .SH "SIGNALS" 
317 .PP 
318 The following signals can be used to manipulate the \fBwinbindd\fP daemon\&.
319 .PP 
320 .IP 
321 .IP "\f(CWSIGHUP\fP" 
322 .IP 
323 Reload the \f(CWsmb\&.conf\fP file and apply any parameter changes to the running
324 version of \fBwinbindd\fP\&.  This signal also clears any cached user and group
325 information\&.
326 .IP 
327 .IP "\f(CWSIGUSR1\fP" 
328 .IP 
329 The \f(CWSIGUSR1\fP signal will cause \fBwinbindd\fP to write status information
330 to the winbind log file including information about the number of user and
331 group ids allocated by \fBwinbindd\fP\&.
332 .IP 
333 Log files are stored in the filename specified by the \fBlog file\fP parameter\&.
334 .IP 
335 .PP 
336 .SH "FILES" 
337 .PP 
338 The following files are relevant to the operation of the \fBwinbindd\fP
339 daemon\&.
340 .PP 
341 .IP 
342 .IP "/etc/nsswitch\&.conf(5)" 
343 .IP 
344 Name service switch configuration file\&.
345 .IP 
346 .IP "/tmp/\&.winbindd/pipe" 
347 .IP 
348 The UNIX pipe over which clients communicate with the \fBwinbindd\fP program\&.
349 For security reasons, the winbind client will only attempt to connect to the
350 \fBwinbindd\fP daemon if both the \f(CW/tmp/\&.winbindd\fP directory and
351 \f(CW/tmp/\&.winbindd/pipe\fP file are owned by root\&.
352 .IP 
353 .IP "/lib/libnss_winbind\&.so\&.X" 
354 .IP 
355 Implementation of name service switch library\&. 
356 .IP 
357 .IP "$LOCKDIR/winbindd_idmap\&.tdb" 
358 .IP 
359 Storage for the Windows NT rid to UNIX user/group id mapping\&.  The lock
360 directory is specified when Samba is initially compiled using the
361 \f(CW--with-lockdir\fP option\&.  This directory is by default
362 \f(CW/usr/local/samba/var/locks\fP\&.
363 .IP 
364 .IP "$LOCKDIR/winbindd_cache\&.tdb" 
365 .IP 
366 Storage for cached user and group information\&.
367 .IP 
368 .PP 
369 .SH "SEE ALSO" 
370 .PP 
371 \fBsamba(7)\fP, \fBsmb\&.conf(5)\fP, 
372 \fBnsswitch\&.conf(5)\fP
373 .PP 
374 .SH "AUTHOR" 
375 .PP 
376 The original Samba software and related utilities were created by
377 Andrew Tridgell\&. Samba is now developed by the Samba Team as an Open
378 Source project\&.
379 .PP 
380 \fBwinbindd\fP was written by Tim Potter\&.