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>
8 <refmiscinfo class="source">Samba</refmiscinfo>
9 <refmiscinfo class="manual">System Administration tools</refmiscinfo>
10 <refmiscinfo class="version">4.0</refmiscinfo>
15 <refname>winbindd</refname>
16 <refpurpose>Name Service Switch daemon for resolving names
17 from NT servers</refpurpose>
22 <command>winbindd</command>
23 <arg choice="opt">-D</arg>
24 <arg choice="opt">-F</arg>
25 <arg choice="opt">-S</arg>
26 <arg choice="opt">-i</arg>
27 <arg choice="opt">-d <debug level></arg>
28 <arg choice="opt">-s <smb config file></arg>
29 <arg choice="opt">-n</arg>
34 <title>DESCRIPTION</title>
36 <para>This program is part of the <citerefentry><refentrytitle>samba</refentrytitle>
37 <manvolnum>7</manvolnum></citerefentry> suite.</para>
39 <para><command>winbindd</command> is a daemon that provides
40 a number of services to the Name Service Switch capability found
41 in most modern C libraries, to arbitrary applications via PAM
42 and <command>ntlm_auth</command> and to Samba itself.</para>
44 <para>Even if winbind is not used for nsswitch, it still provides a
45 service to <command>smbd</command>, <command>ntlm_auth</command>
46 and the <command>pam_winbind.so</command> PAM module, by managing connections to
47 domain controllers. In this configuration the
48 <smbconfoption name="idmap config * : range"/>
49 parameter is not required. (This is known as `netlogon proxy only mode'.)</para>
51 <para> The Name Service Switch allows user
52 and system information to be obtained from different databases
53 services such as NIS or DNS. The exact behaviour can be configured
54 through the <filename>/etc/nsswitch.conf</filename> file.
55 Users and groups are allocated as they are resolved to a range
56 of user and group ids specified by the administrator of the
59 <para>The service provided by <command>winbindd</command> is called `winbind' and
60 can be used to resolve user and group information from a
61 Windows NT server. The service can also provide authentication
62 services via an associated PAM module. </para>
65 The <filename>pam_winbind</filename> module supports the
66 <parameter>auth</parameter>, <parameter>account</parameter>
67 and <parameter>password</parameter>
68 module-types. It should be noted that the
69 <parameter>account</parameter> module simply performs a getpwnam() to verify that
70 the system can obtain a uid for the user, as the domain
71 controller has already performed access control. If the
72 <filename>libnss_winbind</filename> library has been correctly
73 installed, or an alternate source of names configured, this should always succeed.
76 <para>The following nsswitch databases are implemented by
77 the winbindd service: </para>
82 <listitem><para>This feature is only available on IRIX.
83 User information traditionally stored in
84 the <filename>hosts(5)</filename> file and used by
85 <command>gethostbyname(3)</command> functions. Names are
86 resolved through the WINS server or by broadcast.
92 <listitem><para>User information traditionally stored in
93 the <filename>passwd(5)</filename> file and used by
94 <command>getpwent(3)</command> functions. </para></listitem>
99 <listitem><para>Group information traditionally stored in
100 the <filename>group(5)</filename> file and used by
101 <command>getgrent(3)</command> functions. </para></listitem>
105 <para>For example, the following simple configuration in the
106 <filename>/etc/nsswitch.conf</filename> file can be used to initially
107 resolve user and group information from <filename>/etc/passwd
108 </filename> and <filename>/etc/group</filename> and then from the
113 passwd: files winbind
115 ## only available on IRIX: use winbind to resolve hosts:
116 # hosts: files dns winbind
117 ## All other NSS enabled systems should use libnss_wins.so like this:
118 hosts: files dns wins
122 <para>The following simple configuration in the
123 <filename>/etc/nsswitch.conf</filename> file can be used to initially
124 resolve hostnames from <filename>/etc/hosts</filename> and then from the
134 <title>OPTIONS</title>
139 <listitem><para>If specified, this parameter causes
140 the server to operate as a daemon. That is, it detaches
141 itself and runs in the background on the appropriate port.
142 This switch is assumed if <command>winbindd</command> is
143 executed on the command line of a shell.
149 <listitem><para>If specified, this parameter causes
150 the main <command>winbindd</command> process to not daemonize,
151 i.e. double-fork and disassociate with the terminal.
152 Child processes are still created as normal to service
153 each connection request, but the main process does not
154 exit. This operation mode is suitable for running
155 <command>winbindd</command> under process supervisors such
156 as <command>supervise</command> and <command>svscan</command>
157 from Daniel J. Bernstein's <command>daemontools</command>
158 package, or the AIX process monitor.
164 <listitem><para>If specified, this parameter causes
165 <command>winbindd</command> to log to standard output rather
166 than a file.</para></listitem>
169 &stdarg.server.debug;
175 <listitem><para>Tells <command>winbindd</command> to not
176 become a daemon and detach from the current terminal. This
177 option is used by developers when interactive debugging
178 of <command>winbindd</command> is required.
179 <command>winbindd</command> also logs to standard output,
180 as if the <command>-S</command> parameter had been given.
186 <listitem><para>Disable some caching. This means winbindd will
187 often have to wait for a response from the domain controller
188 before it can respond to a client and this thus makes things
189 slower. The results will however be more accurate, since
190 results from the cache might not be up-to-date. This
191 might also temporarily hang winbindd if the DC doesn't respond.
192 This does not disable the samlogon cache, which is required for
193 group membership tracking in trusted environments.
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>
228 <title>CONFIGURATION</title>
230 <para>Configuration of the <command>winbindd</command> daemon
231 is done through configuration parameters in the <citerefentry>
232 <refentrytitle>smb.conf</refentrytitle><manvolnum>5</manvolnum>
233 </citerefentry> file. All parameters should be specified in the
234 [global] section of smb.conf. </para>
238 <smbconfoption name="winbind separator"/></para></listitem>
240 <smbconfoption name="idmap config * : range"/></para></listitem>
242 <smbconfoption name="idmap config * : backend"/></para></listitem>
244 <smbconfoption name="winbind cache time"/></para></listitem>
246 <smbconfoption name="winbind enum users"/></para></listitem>
248 <smbconfoption name="winbind enum groups"/></para></listitem>
250 <smbconfoption name="template homedir"/></para></listitem>
252 <smbconfoption name="template shell"/></para></listitem>
254 <smbconfoption name="winbind use default domain"/></para></listitem>
256 <smbconfoption name="winbind: rpc only"/>
257 Setting this parameter forces winbindd to use RPC
258 instead of LDAP to retrieve information from Domain
266 <title>EXAMPLE SETUP</title>
269 To setup winbindd for user and group lookups plus
270 authentication from a domain controller use something like the
271 following setup. This was tested on an early Red Hat Linux box.
274 <para>In <filename>/etc/nsswitch.conf</filename> put the
277 passwd: files winbind
282 <para>In <filename>/etc/pam.d/*</filename> replace the <parameter>
283 auth</parameter> lines with something like this:
285 auth required /lib/security/pam_securetty.so
286 auth required /lib/security/pam_nologin.so
287 auth sufficient /lib/security/pam_winbind.so
288 auth required /lib/security/pam_unix.so \
289 use_first_pass shadow nullok
294 The PAM module pam_unix has recently replaced the module pam_pwdb.
295 Some Linux systems use the module pam_unix2 in place of pam_unix.
298 <para>Note in particular the use of the <parameter>sufficient
299 </parameter> keyword and the <parameter>use_first_pass</parameter> keyword. </para>
301 <para>Now replace the account lines with this: </para>
303 <para><command>account required /lib/security/pam_winbind.so
306 <para>The next step is to join the domain. To do that use the
307 <command>net</command> program like this: </para>
309 <para><command>net join -S PDC -U Administrator</command></para>
311 <para>The username after the <parameter>-U</parameter> can be any
312 Domain user that has administrator privileges on the machine.
313 Substitute the name or IP of your PDC for "PDC".</para>
315 <para>Next copy <filename>libnss_winbind.so</filename> to
316 <filename>/lib</filename> and <filename>pam_winbind.so
317 </filename> to <filename>/lib/security</filename>. A symbolic link needs to be
318 made from <filename>/lib/libnss_winbind.so</filename> to
319 <filename>/lib/libnss_winbind.so.2</filename>. If you are using an
320 older version of glibc then the target of the link should be
321 <filename>/lib/libnss_winbind.so.1</filename>.</para>
323 <para>Finally, setup a <citerefentry><refentrytitle>smb.conf</refentrytitle>
324 <manvolnum>5</manvolnum></citerefentry> containing directives like the
328 winbind separator = +
329 winbind cache time = 10
330 template shell = /bin/bash
331 template homedir = /home/%D/%U
332 idmap config * : range = 10000-20000
336 </programlisting></para>
339 <para>Now start winbindd and you should find that your user and
340 group database is expanded to include your NT users and groups,
341 and that you can login to your unix box as a domain user, using
342 the DOMAIN+user syntax for the username. You may wish to use the
343 commands <command>getent passwd</command> and <command>getent group
344 </command> to confirm the correct operation of winbindd.</para>
351 <para>The following notes are useful when configuring and
352 running <command>winbindd</command>: </para>
354 <para><citerefentry><refentrytitle>nmbd</refentrytitle>
355 <manvolnum>8</manvolnum></citerefentry> must be running on the local machine
356 for <command>winbindd</command> to work. </para>
358 <para>PAM is really easy to misconfigure. Make sure you know what
359 you are doing when modifying PAM configuration files. It is possible
360 to set up PAM such that you can no longer log into your system. </para>
362 <para>If more than one UNIX machine is running <command>winbindd</command>,
363 then in general the user and groups ids allocated by winbindd will not
364 be the same. The user and group ids will only be valid for the local
365 machine, unless a shared <smbconfoption name="idmap config * : backend"/> is configured.</para>
367 <para>If the the Windows NT SID to UNIX user and group id mapping
368 file is damaged or destroyed then the mappings will be lost. </para>
373 <title>SIGNALS</title>
375 <para>The following signals can be used to manipulate the
376 <command>winbindd</command> daemon. </para>
381 <listitem><para>Reload the <citerefentry><refentrytitle>smb.conf</refentrytitle>
382 <manvolnum>5</manvolnum></citerefentry> file and
383 apply any parameter changes to the running
384 version of winbindd. This signal also clears any cached
385 user and group information. The list of other domains trusted
386 by winbindd is also reloaded. </para></listitem>
391 <listitem><para>The SIGUSR2 signal will cause <command>
392 winbindd</command> to write status information to the winbind
395 <para>Log files are stored in the filename specified by the
396 log file parameter.</para></listitem>
406 <term><filename>/etc/nsswitch.conf(5)</filename></term>
407 <listitem><para>Name service switch configuration file.</para>
412 <term>/tmp/.winbindd/pipe</term>
413 <listitem><para>The UNIX pipe over which clients communicate with
414 the <command>winbindd</command> program. For security reasons, the
415 winbind client will only attempt to connect to the winbindd daemon
416 if both the <filename>/tmp/.winbindd</filename> directory
417 and <filename>/tmp/.winbindd/pipe</filename> file are owned by
418 root. </para></listitem>
422 <term>$LOCKDIR/winbindd_privileged/pipe</term>
423 <listitem><para>The UNIX pipe over which 'privileged' clients
424 communicate with the <command>winbindd</command> program. For security
425 reasons, access to some winbindd functions - like those needed by
426 the <command>ntlm_auth</command> utility - is restricted. By default,
427 only users in the 'root' group will get this access, however the administrator
428 may change the group permissions on $LOCKDIR/winbindd_privileged to allow
429 programs like 'squid' to use ntlm_auth.
430 Note that the winbind client will only attempt to connect to the winbindd daemon
431 if both the <filename>$LOCKDIR/winbindd_privileged</filename> directory
432 and <filename>$LOCKDIR/winbindd_privileged/pipe</filename> file are owned by
433 root. </para></listitem>
437 <term>/lib/libnss_winbind.so.X</term>
438 <listitem><para>Implementation of name service switch library.
443 <term>$LOCKDIR/winbindd_idmap.tdb</term>
444 <listitem><para>Storage for the Windows NT rid to UNIX user/group
445 id mapping. The lock directory is specified when Samba is initially
446 compiled using the <parameter>--with-lockdir</parameter> option.
447 This directory is by default <filename>/usr/local/samba/var/locks
448 </filename>. </para></listitem>
452 <term>$LOCKDIR/winbindd_cache.tdb</term>
453 <listitem><para>Storage for cached user and group information.
461 <title>VERSION</title>
463 <para>This man page is correct for version 3 of
464 the Samba suite.</para>
468 <title>SEE ALSO</title>
470 <para><filename>nsswitch.conf(5)</filename>, <citerefentry>
471 <refentrytitle>samba</refentrytitle>
472 <manvolnum>7</manvolnum></citerefentry>, <citerefentry>
473 <refentrytitle>wbinfo</refentrytitle>
474 <manvolnum>1</manvolnum></citerefentry>, <citerefentry>
475 <refentrytitle>ntlm_auth</refentrytitle>
476 <manvolnum>8</manvolnum></citerefentry>, <citerefentry>
477 <refentrytitle>smb.conf</refentrytitle>
478 <manvolnum>5</manvolnum></citerefentry>, <citerefentry>
479 <refentrytitle>pam_winbind</refentrytitle>
480 <manvolnum>8</manvolnum></citerefentry></para>
484 <title>AUTHOR</title>
486 <para>The original Samba software and related utilities
487 were created by Andrew Tridgell. Samba is now developed
488 by the Samba Team as an Open Source project similar
489 to the way the Linux kernel is developed.</para>
491 <para><command>wbinfo</command> and <command>winbindd</command> were
492 written by Tim Potter.</para>
494 <para>The conversion to DocBook for Samba 2.2 was done
495 by Gerald Carter. The conversion to DocBook XML 4.2 for
496 Samba 3.0 was done by Alexander Bokovoy.</para>