Fix from Toomas Soome <tsoome@ut.ee> that will eventually allow per-user
[Samba.git] / docs / manpages / winbindd.8
blob9da9250b5713bc2d3cc118d2525342e200e82fa1
1 .TH WINBINDD 8 "30 Jan 2001" "winbindd 2.2.0-alpha2"
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 
49 .nf 
52   passwd:         files winbind
53   group:          files winbind
55 .fi 
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 \fBwinbindd\fP to not become a daemon and detach from the current terminal\&.
71 This option is used by developers when interactive debugging of \fBwinbindd\fP 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 \fBwinbindd\fP 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 \fBwinbindd\fP 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 \fBwinbindd\fP 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:
192 .nf 
195    passwd:     files winbind
196    group:      files winbind
198 .fi 
201 .PP 
202 In \f(CW/etc/pam\&.d/*\fP replace the \f(CWauth\fP lines with something like this:
204 .nf 
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
212 .fi 
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:
221 .nf 
224         account    required     /lib/security/pam_winbind\&.so
226 .fi 
229 .PP 
230 The next step is to join the domain\&. To do that use the samedit
231 program like this:
233 .nf 
236         samedit -S \'*\' -W DOMAIN -UAdministrator
238 .fi 
241 .PP 
242 Then within samedit run the command:
244 .nf 
247         createuser MACHINE$ -j DOMAIN -L
249 .fi 
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:
261 .nf 
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 = *
275 .fi 
278 .PP 
279 Now start \fBwinbindd\fP 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 \fBwinbindd\fP\&. 
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 \fBwinbindd\fP queries the list of trusted domains for the Windows NT server
297 on startup and when a SIGHUP is received\&.  Thus, for a running \fBwinbindd\fP
298 to become aware of new trust relationships between servers, it must be sent
299 a SIGHUP signal\&.
300 .IP 
301 .IP "" 
302 Client processes resolving names through the \fBwinbindd\fP nsswitch module
303 read an environment variable named \f(CWWINBINDD_DOMAIN\fP\&.  If this variable
304 contains a comma separated list of Windows NT domain names, then \fBwinbindd\fP
305 will only resolve users and groups within those Windows NT domains\&.
306 .IP 
307 .IP "" 
308 PAM is really easy to misconfigure\&.  Make sure you know what you are doing
309 when modifying PAM configuration files\&.  It is possible to set up PAM
310 such that you can no longer log into your system\&.
311 .IP 
312 .IP "" 
313 If more than one UNIX machine is running \fBwinbindd\fP, then in general the
314 user and groups ids allocated by \fBwinbindd\fP will not be the same\&.  The
315 user and group ids will only be valid for the local machine\&.  
316 .IP 
317 .IP "" 
318 If the the Windows NT RID to UNIX user and group id mapping file
319 is damaged or destroyed then the mappings will be lost\&.
320 .IP 
321 .PP 
322 .SH "SIGNALS" 
323 .PP 
324 The following signals can be used to manipulate the \fBwinbindd\fP daemon\&.
325 .PP 
326 .IP 
327 .IP "\f(CWSIGHUP\fP" 
328 .IP 
329 Reload the \f(CWsmb\&.conf\fP file and apply any parameter changes to the running
330 version of \fBwinbindd\fP\&.  This signal also clears any cached user and group
331 information\&.  The list of other domains trusted by \fBwinbindd\fP is also
332 reloaded\&. 
333 .IP 
334 .IP "\f(CWSIGUSR1\fP" 
335 .IP 
336 The \f(CWSIGUSR1\fP signal will cause \fBwinbindd\fP to write status information
337 to the winbind log file including information about the number of user and
338 group ids allocated by \fBwinbindd\fP\&.
339 .IP 
340 Log files are stored in the filename specified by the \fBlog file\fP parameter\&.
341 .IP 
342 .PP 
343 .SH "FILES" 
344 .PP 
345 The following files are relevant to the operation of the \fBwinbindd\fP
346 daemon\&.
347 .PP 
348 .IP 
349 .IP "/etc/nsswitch\&.conf(5)" 
350 .IP 
351 Name service switch configuration file\&.
352 .IP 
353 .IP "/tmp/\&.winbindd/pipe" 
354 .IP 
355 The UNIX pipe over which clients communicate with the \fBwinbindd\fP program\&.
356 For security reasons, the winbind client will only attempt to connect to the
357 \fBwinbindd\fP daemon if both the \f(CW/tmp/\&.winbindd\fP directory and
358 \f(CW/tmp/\&.winbindd/pipe\fP file are owned by root\&.
359 .IP 
360 .IP "/lib/libnss_winbind\&.so\&.X" 
361 .IP 
362 Implementation of name service switch library\&. 
363 .IP 
364 .IP "$LOCKDIR/winbindd_idmap\&.tdb" 
365 .IP 
366 Storage for the Windows NT rid to UNIX user/group id mapping\&.  The lock
367 directory is specified when Samba is initially compiled using the
368 \f(CW--with-lockdir\fP option\&.  This directory is by default
369 \f(CW/usr/local/samba/var/locks\fP\&.
370 .IP 
371 .IP "$LOCKDIR/winbindd_cache\&.tdb" 
372 .IP 
373 Storage for cached user and group information\&.
374 .IP 
375 .PP 
376 .SH "SEE ALSO" 
377 .PP 
378 \fBsamba(7)\fP, \fBsmb\&.conf(5)\fP, 
379 \fBnsswitch\&.conf(5)\fP, \fBwbinfo(1)\fP
380 .PP 
381 .SH "AUTHOR" 
382 .PP 
383 The original Samba software and related utilities were created by
384 Andrew Tridgell\&. Samba is now developed by the Samba Team as an Open
385 Source project\&.
386 .PP 
387 \fBwinbindd\fP was written by Tim Potter\&.