1 <?xml version="1.0" encoding="iso-8859-1"?>
2 <!DOCTYPE refentry PUBLIC "-//Samba-Team//DTD DocBook V4.2-Based Variant V1.0//EN" "http://www.samba.org/samba/DTD/samba-doc">
3 <refentry id="winbindd.8">
6 <refentrytitle>winbindd</refentrytitle>
7 <manvolnum>8</manvolnum>
12 <refname>winbindd</refname>
13 <refpurpose>Name Service Switch daemon for resolving names
14 from NT servers</refpurpose>
19 <command>winbindd</command>
20 <arg choice="opt">-D</arg>
21 <arg choice="opt">-F</arg>
22 <arg choice="opt">-S</arg>
23 <arg choice="opt">-i</arg>
24 <arg choice="opt">-Y</arg>
25 <arg choice="opt">-d <debug level></arg>
26 <arg choice="opt">-s <smb config file></arg>
27 <arg choice="opt">-n</arg>
32 <title>DESCRIPTION</title>
34 <para>This program is part of the <citerefentry><refentrytitle>samba</refentrytitle>
35 <manvolnum>7</manvolnum></citerefentry> suite.</para>
37 <para><command>winbindd</command> is a daemon that provides
38 a number of services to the Name Service Switch capability found
39 in most modern C libraries, to arbitary applications via PAM
40 and <command>ntlm_auth</command> and to Samba itself.</para>
42 <para>Even if winbind is not used for nsswitch, it still provides a
43 service to <command>smbd</command>, <command>ntlm_auth</command>
44 and the <command>pam_winbind.so</command> PAM module, by managing connections to
45 domain controllers. In this configuraiton the
46 <smbconfoption name="idmap uid"/> and
47 <smbconfoption name="idmap gid"/>
48 parameters are not required. (This is known as `netlogon proxy only mode'.)</para>
50 <para> The Name Service Switch allows user
51 and system information to be obtained from different databases
52 services such as NIS or DNS. The exact behaviour can be configured
53 throught the <filename>/etc/nsswitch.conf</filename> file.
54 Users and groups are allocated as they are resolved to a range
55 of user and group ids specified by the administrator of the
58 <para>The service provided by <command>winbindd</command> is called `winbind' and
59 can be used to resolve user and group information from a
60 Windows NT server. The service can also provide authentication
61 services via an associated PAM module. </para>
64 The <filename>pam_winbind</filename> module supports the
65 <parameter>auth</parameter>, <parameter>account</parameter>
66 and <parameter>password</parameter>
67 module-types. It should be noted that the
68 <parameter>account</parameter> module simply performs a getpwnam() to verify that
69 the system can obtain a uid for the user, as the domain
70 controller has already performed access control. If the
71 <filename>libnss_winbind</filename> library has been correctly
72 installed, or an alternate source of names configured, this should always succeed.
75 <para>The following nsswitch databases are implemented by
76 the winbindd service: </para>
81 <listitem><para>If specified, this parameter causes
82 the server to operate as a daemon. That is, it detaches
83 itself and runs in the background on the appropriate port.
84 This switch is assumed if <command>winbindd</command> is
85 executed on the command line of a shell.
91 <listitem><para>This feature is only available on IRIX.
92 User information traditionally stored in
93 the <filename>hosts(5)</filename> file and used by
94 <command>gethostbyname(3)</command> functions. Names are
95 resolved through the WINS server or by broadcast.
101 <listitem><para>User information traditionally stored in
102 the <filename>passwd(5)</filename> file and used by
103 <command>getpwent(3)</command> functions. </para></listitem>
108 <listitem><para>Group information traditionally stored in
109 the <filename>group(5)</filename> file and used by
110 <command>getgrent(3)</command> functions. </para></listitem>
114 <para>For example, the following simple configuration in the
115 <filename>/etc/nsswitch.conf</filename> file can be used to initially
116 resolve user and group information from <filename>/etc/passwd
117 </filename> and <filename>/etc/group</filename> and then from the
120 passwd: files winbind
122 ## only available on IRIX; Linux users should us libnss_wins.so
123 hosts: files dns winbind
124 </programlisting></para>
126 <para>The following simple configuration in the
127 <filename>/etc/nsswitch.conf</filename> file can be used to initially
128 resolve hostnames from <filename>/etc/hosts</filename> and then from the
138 <title>OPTIONS</title>
143 <listitem><para>If specified, this parameter causes
144 the main <command>winbindd</command> process to not daemonize,
145 i.e. double-fork and disassociate with the terminal.
146 Child processes are still created as normal to service
147 each connection request, but the main process does not
148 exit. This operation mode is suitable for running
149 <command>winbindd</command> under process supervisors such
150 as <command>supervise</command> and <command>svscan</command>
151 from Daniel J. Bernstein's <command>daemontools</command>
152 package, or the AIX process monitor.
158 <listitem><para>If specified, this parameter causes
159 <command>winbindd</command> to log to standard output rather
160 than a file.</para></listitem>
168 <listitem><para>Tells <command>winbindd</command> to not
169 become a daemon and detach from the current terminal. This
170 option is used by developers when interactive debugging
171 of <command>winbindd</command> is required.
172 <command>winbindd</command> also logs to standard output,
173 as if the <command>-S</command> parameter had been given.
179 <listitem><para>Disable caching. This means winbindd will
180 always have to wait for a response from the domain controller
181 before it can respond to a client and this thus makes things
182 slower. The results will however be more accurate, since
183 results from the cache might not be up-to-date. This
184 might also temporarily hang winbindd if the DC doesn't respond.
190 <listitem><para>Single daemon mode. This means winbindd will run
191 as a single process (the mode of operation in Samba 2.2). Winbindd's
192 default behavior is to launch a child process that is responsible for
193 updating expired cache entries.
202 <title>NAME AND ID RESOLUTION</title>
204 <para>Users and groups on a Windows NT server are assigned
205 a security id (SID) which is globally unique when the
206 user or group is created. To convert the Windows NT user or group
207 into a unix user or group, a mapping between SIDs and unix user
208 and group ids is required. This is one of the jobs that <command>
209 winbindd</command> performs. </para>
211 <para>As winbindd users and groups are resolved from a server, user
212 and group ids are allocated from a specified range. This
213 is done on a first come, first served basis, although all existing
214 users and groups will be mapped as soon as a client performs a user
215 or group enumeration command. The allocated unix ids are stored
216 in a database and will be remembered. </para>
218 <para>WARNING: The SID to unix id database is the only location
219 where the user and group mappings are stored by winbindd. If this
220 store is deleted or corrupted, there is no way for winbindd to
221 determine which user and group ids correspond to Windows NT user
222 and group rids. </para>
224 <para>See the <smbconfoption><name>idmap
225 domains</name></smbconfoption> or the old <smbconfoption><name>idmap
226 backend</name></smbconfoption> parameters in
227 <filename>smb.conf</filename> for options for sharing this
228 database, such as via LDAP.</para>
233 <title>CONFIGURATION</title>
235 <para>Configuration of the <command>winbindd</command> daemon
236 is done through configuration parameters in the <citerefentry>
237 <refentrytitle>smb.conf</refentrytitle><manvolnum>5</manvolnum>
238 </citerefentry> file. All parameters should be specified in the
239 [global] section of smb.conf. </para>
243 <smbconfoption name="winbind separator"/></para></listitem>
245 <smbconfoption name="idmap uid"/></para></listitem>
247 <smbconfoption name="idmap gid"/></para></listitem>
249 <smbconfoption name="idmap backend"/></para></listitem>
251 <smbconfoption name="winbind cache time"/></para></listitem>
253 <smbconfoption name="winbind enum users"/></para></listitem>
255 <smbconfoption name="winbind enum groups"/></para></listitem>
257 <smbconfoption name="template homedir"/></para></listitem>
259 <smbconfoption name="template shell"/></para></listitem>
261 <smbconfoption name="winbind use default domain"/></para></listitem>
263 <smbconfoption name="winbind: rpc only"/>
264 Setting this parameter forces winbindd to use RPC
265 instead of LDAP to retrieve information from Domain
273 <title>EXAMPLE SETUP</title>
276 To setup winbindd for user and group lookups plus
277 authentication from a domain controller use something like the
278 following setup. This was tested on an early Red Hat Linux box.
281 <para>In <filename>/etc/nsswitch.conf</filename> put the
284 passwd: files winbind
289 <para>In <filename>/etc/pam.d/*</filename> replace the <parameter>
290 auth</parameter> lines with something like this:
292 auth required /lib/security/pam_securetty.so
293 auth required /lib/security/pam_nologin.so
294 auth sufficient /lib/security/pam_winbind.so
295 auth required /lib/security/pam_unix.so \
296 use_first_pass shadow nullok
301 The PAM module pam_unix has recently replaced the module pam_pwdb.
302 Some Linux systems use the module pam_unix2 in place of pam_unix.
305 <para>Note in particular the use of the <parameter>sufficient
306 </parameter> keyword and the <parameter>use_first_pass</parameter> keyword. </para>
308 <para>Now replace the account lines with this: </para>
310 <para><command>account required /lib/security/pam_winbind.so
313 <para>The next step is to join the domain. To do that use the
314 <command>net</command> program like this: </para>
316 <para><command>net join -S PDC -U Administrator</command></para>
318 <para>The username after the <parameter>-U</parameter> can be any
319 Domain user that has administrator privileges on the machine.
320 Substitute the name or IP of your PDC for "PDC".</para>
322 <para>Next copy <filename>libnss_winbind.so</filename> to
323 <filename>/lib</filename> and <filename>pam_winbind.so
324 </filename> to <filename>/lib/security</filename>. A symbolic link needs to be
325 made from <filename>/lib/libnss_winbind.so</filename> to
326 <filename>/lib/libnss_winbind.so.2</filename>. If you are using an
327 older version of glibc then the target of the link should be
328 <filename>/lib/libnss_winbind.so.1</filename>.</para>
330 <para>Finally, setup a <citerefentry><refentrytitle>smb.conf</refentrytitle>
331 <manvolnum>5</manvolnum></citerefentry> containing directives like the
335 winbind separator = +
336 winbind cache time = 10
337 template shell = /bin/bash
338 template homedir = /home/%D/%U
339 idmap uid = 10000-20000
340 idmap gid = 10000-20000
344 </programlisting></para>
347 <para>Now start winbindd and you should find that your user and
348 group database is expanded to include your NT users and groups,
349 and that you can login to your unix box as a domain user, using
350 the DOMAIN+user syntax for the username. You may wish to use the
351 commands <command>getent passwd</command> and <command>getent group
352 </command> to confirm the correct operation of winbindd.</para>
359 <para>The following notes are useful when configuring and
360 running <command>winbindd</command>: </para>
362 <para><citerefentry><refentrytitle>nmbd</refentrytitle>
363 <manvolnum>8</manvolnum></citerefentry> must be running on the local machine
364 for <command>winbindd</command> to work. </para>
366 <para>PAM is really easy to misconfigure. Make sure you know what
367 you are doing when modifying PAM configuration files. It is possible
368 to set up PAM such that you can no longer log into your system. </para>
370 <para>If more than one UNIX machine is running <command>winbindd</command>,
371 then in general the user and groups ids allocated by winbindd will not
372 be the same. The user and group ids will only be valid for the local
373 machine, unless a shared <smbconfoption><name>idmap
374 backend</name></smbconfoption> is configured.</para>
376 <para>If the the Windows NT SID to UNIX user and group id mapping
377 file is damaged or destroyed then the mappings will be lost. </para>
382 <title>SIGNALS</title>
384 <para>The following signals can be used to manipulate the
385 <command>winbindd</command> daemon. </para>
390 <listitem><para>Reload the <citerefentry><refentrytitle>smb.conf</refentrytitle>
391 <manvolnum>5</manvolnum></citerefentry> file and
392 apply any parameter changes to the running
393 version of winbindd. This signal also clears any cached
394 user and group information. The list of other domains trusted
395 by winbindd is also reloaded. </para></listitem>
400 <listitem><para>The SIGUSR2 signal will cause <command>
401 winbindd</command> to write status information to the winbind
404 <para>Log files are stored in the filename specified by the
405 log file parameter.</para></listitem>
415 <term><filename>/etc/nsswitch.conf(5)</filename></term>
416 <listitem><para>Name service switch configuration file.</para>
421 <term>/tmp/.winbindd/pipe</term>
422 <listitem><para>The UNIX pipe over which clients communicate with
423 the <command>winbindd</command> program. For security reasons, the
424 winbind client will only attempt to connect to the winbindd daemon
425 if both the <filename>/tmp/.winbindd</filename> directory
426 and <filename>/tmp/.winbindd/pipe</filename> file are owned by
427 root. </para></listitem>
431 <term>$LOCKDIR/winbindd_privileged/pipe</term>
432 <listitem><para>The UNIX pipe over which 'privileged' clients
433 communicate with the <command>winbindd</command> program. For security
434 reasons, access to some winbindd functions - like those needed by
435 the <command>ntlm_auth</command> utility - is restricted. By default,
436 only users in the 'root' group will get this access, however the administrator
437 may change the group permissions on $LOCKDIR/winbindd_privileged to allow
438 programs like 'squid' to use ntlm_auth.
439 Note that the winbind client will only attempt to connect to the winbindd daemon
440 if both the <filename>$LOCKDIR/winbindd_privileged</filename> directory
441 and <filename>$LOCKDIR/winbindd_privileged/pipe</filename> file are owned by
442 root. </para></listitem>
446 <term>/lib/libnss_winbind.so.X</term>
447 <listitem><para>Implementation of name service switch library.
452 <term>$LOCKDIR/winbindd_idmap.tdb</term>
453 <listitem><para>Storage for the Windows NT rid to UNIX user/group
454 id mapping. The lock directory is specified when Samba is initially
455 compiled using the <parameter>--with-lockdir</parameter> option.
456 This directory is by default <filename>/usr/local/samba/var/locks
457 </filename>. </para></listitem>
461 <term>$LOCKDIR/winbindd_cache.tdb</term>
462 <listitem><para>Storage for cached user and group information.
470 <title>VERSION</title>
472 <para>This man page is correct for version 3.0 of
473 the Samba suite.</para>
477 <title>SEE ALSO</title>
479 <para><filename>nsswitch.conf(5)</filename>, <citerefentry>
480 <refentrytitle>samba</refentrytitle>
481 <manvolnum>7</manvolnum></citerefentry>, <citerefentry>
482 <refentrytitle>wbinfo</refentrytitle>
483 <manvolnum>1</manvolnum></citerefentry>, <citerefentry>
484 <refentrytitle>ntlm_auth</refentrytitle>
485 <manvolnum>8</manvolnum></citerefentry>, <citerefentry>
486 <refentrytitle>smb.conf</refentrytitle>
487 <manvolnum>5</manvolnum></citerefentry>, <citerefentry>
488 <refentrytitle>pam_winbind</refentrytitle>
489 <manvolnum>8</manvolnum></citerefentry></para>
493 <title>AUTHOR</title>
495 <para>The original Samba software and related utilities
496 were created by Andrew Tridgell. Samba is now developed
497 by the Samba Team as an Open Source project similar
498 to the way the Linux kernel is developed.</para>
500 <para><command>wbinfo</command> and <command>winbindd</command> were
501 written by Tim Potter.</para>
503 <para>The conversion to DocBook for Samba 2.2 was done
504 by Gerald Carter. The conversion to DocBook XML 4.2 for
505 Samba 3.0 was done by Alexander Bokovoy.</para>