Apparantly putting a newline in the "wrong" place can cause the generated
[import/samba-docs-svnimport.git] / manpages-3 / winbindd.8.xml
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">
4
5 <refmeta>
6         <refentrytitle>winbindd</refentrytitle>
7         <manvolnum>8</manvolnum>
8 </refmeta>
9
10
11 <refnamediv>
12         <refname>winbindd</refname>
13         <refpurpose>Name Service Switch daemon for resolving names 
14         from NT servers</refpurpose>
15 </refnamediv>
16
17 <refsynopsisdiv>
18         <cmdsynopsis>
19                 <command>winbindd</command>
20                 <arg choice="opt">-F</arg>
21                 <arg choice="opt">-S</arg>
22                 <arg choice="opt">-i</arg>
23                 <arg choice="opt">-Y</arg>
24                 <arg choice="opt">-d &lt;debug level&gt;</arg>
25                 <arg choice="opt">-s &lt;smb config file&gt;</arg>
26                 <arg choice="opt">-n</arg>
27         </cmdsynopsis>
28 </refsynopsisdiv>
29
30 <refsect1>
31         <title>DESCRIPTION</title>
32
33         <para>This program is part of the <citerefentry><refentrytitle>samba</refentrytitle>
34         <manvolnum>7</manvolnum></citerefentry> suite.</para>
35
36         <para><command>winbindd</command> is a daemon that provides 
37         a number of services to the Name Service Switch capability found
38         in most modern C libraries, to arbitary applications via PAM
39         and <command>ntlm_auth</command> and to Samba itself.</para>
40
41     <para>Even if winbind is not used for nsswitch, it still provides a
42     service to <command>smbd</command>, <command>ntlm_auth</command>
43     and the <command>pam_winbind.so</command> PAM module, by managing connections to
44     domain controllers.  In this configuraiton the
45     <smbconfoption name="idmap uid"/> and
46     <smbconfoption name="idmap gid"/>
47     parameters are not required. (This is known as `netlogon proxy only mode'.)</para>
48
49         <para> The Name Service Switch allows user 
50         and system information to be obtained from different databases 
51         services such as NIS or DNS.  The exact behaviour can be configured 
52         throught the <filename>/etc/nsswitch.conf</filename> file.  
53         Users and groups are allocated as they are resolved to a range 
54         of user and group ids specified by the administrator of the 
55         Samba system.</para>
56
57         <para>The service provided by <command>winbindd</command> is called `winbind' and 
58         can be used to resolve user and group information from a 
59         Windows NT server. The service can also provide authentication
60         services via an associated PAM module. </para>
61         
62         <para>
63         The <filename>pam_winbind</filename> module supports the
64         <parameter>auth</parameter>, <parameter>account</parameter>
65         and <parameter>password</parameter>
66         module-types.  It should be noted that the 
67         <parameter>account</parameter> module simply performs a getpwnam() to verify that
68         the system can obtain a uid for the user, as the domain
69         controller has already performed access control.  If the
70         <filename>libnss_winbind</filename> library has been correctly
71         installed, or an alternate source of names configured, this should always succeed.
72         </para>
73
74         <para>The following nsswitch databases are implemented by 
75         the winbindd service: </para>
76
77         <variablelist>
78                 <varlistentry>
79                 <term>hosts</term>
80                 <listitem><para>This feature is only available on IRIX.
81                 User information traditionally stored in 
82                 the <filename>hosts(5)</filename> file and used by 
83                 <command>gethostbyname(3)</command> functions. Names are
84                 resolved through the WINS server or by broadcast.
85                 </para></listitem>
86                 </varlistentry>
87
88                 <varlistentry>
89                 <term>passwd</term>
90                 <listitem><para>User information traditionally stored in 
91                 the <filename>passwd(5)</filename> file and used by 
92                 <command>getpwent(3)</command> functions. </para></listitem>
93                 </varlistentry>
94
95                 <varlistentry>
96                 <term>group</term>
97                 <listitem><para>Group information traditionally stored in 
98                 the <filename>group(5)</filename> file and used by              
99                 <command>getgrent(3)</command> functions. </para></listitem>
100                 </varlistentry>
101         </variablelist>
102
103         <para>For example, the following simple configuration in the
104         <filename>/etc/nsswitch.conf</filename> file can be used to initially 
105         resolve user and group information from <filename>/etc/passwd
106         </filename> and <filename>/etc/group</filename> and then from the 
107         Windows NT server.
108 <programlisting>
109 passwd:         files winbind
110 group:          files winbind
111 ## only available on IRIX; Linux users should us libnss_wins.so
112 hosts:          files dns winbind
113 </programlisting></para>  
114
115         <para>The following simple configuration in the
116         <filename>/etc/nsswitch.conf</filename> file can be used to initially
117         resolve hostnames from <filename>/etc/hosts</filename> and then from the
118         WINS server.</para>
119 <programlisting>
120 hosts:          files wins
121 </programlisting>
122
123 </refsect1>
124
125
126 <refsect1>
127         <title>OPTIONS</title>
128
129         <variablelist>
130                 <varlistentry>
131                 <term>-F</term>
132                 <listitem><para>If specified, this parameter causes
133                 the main <command>winbindd</command> process to not daemonize,
134                 i.e. double-fork and disassociate with the terminal.
135                 Child processes are still created as normal to service
136                 each connection request, but the main process does not
137                 exit. This operation mode is suitable for running
138                 <command>winbindd</command> under process supervisors such
139                 as <command>supervise</command> and <command>svscan</command>
140                 from Daniel J. Bernstein's <command>daemontools</command>
141                 package, or the AIX process monitor.
142                 </para></listitem>
143                 </varlistentry>
144
145                 <varlistentry>
146                 <term>-S</term>
147                 <listitem><para>If specified, this parameter causes
148                 <command>winbindd</command> to log to standard output rather
149                 than a file.</para></listitem>
150                 </varlistentry>
151
152                 &popt.common.samba;
153                 &stdarg.help;
154
155                 <varlistentry>
156                 <term>-i</term>
157                 <listitem><para>Tells <command>winbindd</command> to not 
158                 become a daemon and detach from the current terminal. This 
159                 option is used by developers when interactive debugging 
160                 of <command>winbindd</command> is required.
161                 <command>winbindd</command> also logs to standard output,
162                 as if the <command>-S</command> parameter had been given.
163                 </para></listitem>
164                 </varlistentry>
165
166                 <varlistentry>
167                 <term>-n</term>
168                 <listitem><para>Disable caching. This means winbindd will 
169                 always have to wait for a response from the domain controller 
170                 before it can respond to a client and this thus makes things 
171                 slower. The results will however be more accurate, since 
172                 results from the cache might not be up-to-date. This 
173                 might also temporarily hang winbindd if the DC doesn't respond.
174                 </para></listitem>
175                 </varlistentry>
176
177                 <varlistentry>
178                 <term>-Y</term>
179                 <listitem><para>Single daemon mode. This means winbindd will run 
180                 as a single process (the mode of operation in Samba 2.2).  Winbindd's 
181                 default behavior is to launch a child process that is responsible for 
182                 updating expired cache entries.
183                 </para></listitem>
184                 </varlistentry>
185
186         </variablelist>
187 </refsect1>
188
189
190 <refsect1>
191         <title>NAME AND ID RESOLUTION</title>
192
193         <para>Users and groups on a Windows NT server are assigned 
194         a security id (SID) which is globally unique when the 
195         user or group is created.  To convert the Windows NT user or group 
196         into a unix user or group, a mapping between SIDs and unix user 
197         and group ids is required.  This is one of the jobs that <command>
198         winbindd</command> performs. </para>
199
200         <para>As winbindd users and groups are resolved from a server, user 
201         and group ids are allocated from a specified range.  This
202         is done on a first come, first served basis, although all existing 
203         users and groups will be mapped as soon as a client performs a user 
204         or group enumeration command.  The allocated unix ids are stored 
205         in a database file under the Samba lock directory and will be 
206         remembered. </para>
207
208         <para>WARNING: The SID to unix id database is the only location 
209         where the user and group mappings are stored by winbindd.  If this 
210         file is deleted or corrupted, there is no way for winbindd to 
211         determine which user and group ids correspond to Windows NT user 
212         and group rids. </para>
213
214         <para>See the <smbconfoption><name>idmap
215         backend</name></smbconfoption> parameter in
216         <filename>smb.conf</filename> for options for sharing this
217         database, such as via LDAP.</para>
218 </refsect1>
219
220
221 <refsect1>
222         <title>CONFIGURATION</title>
223
224         <para>Configuration of the <command>winbindd</command> daemon 
225         is done through configuration parameters in the <citerefentry>
226         <refentrytitle>smb.conf</refentrytitle><manvolnum>5</manvolnum>
227         </citerefentry> file.  All parameters should be specified in the 
228         [global] section of smb.conf. </para>
229
230         <itemizedlist>
231                 <listitem><para>
232                 <smbconfoption name="winbind separator"/></para></listitem>
233                 <listitem><para>
234                 <smbconfoption name="idmap uid"/></para></listitem>
235                 <listitem><para>
236                 <smbconfoption name="idmap gid"/></para></listitem>
237                 <listitem><para>
238                 <smbconfoption name="idmap backend"/></para></listitem>
239                 <listitem><para>
240                 <smbconfoption name="winbind cache time"/></para></listitem>
241                 <listitem><para>
242                 <smbconfoption name="winbind enum users"/></para></listitem>
243                 <listitem><para>
244                 <smbconfoption name="winbind enum groups"/></para></listitem>
245                 <listitem><para>
246                 <smbconfoption name="template homedir"/></para></listitem>
247                 <listitem><para>
248                 <smbconfoption name="template shell"/></para></listitem>
249                 <listitem><para>
250                 <smbconfoption name="winbind use default domain"/></para></listitem>
251         </itemizedlist>
252 </refsect1>
253
254
255 <refsect1>
256         <title>EXAMPLE SETUP</title>
257
258         <para>
259         To setup winbindd for user and group lookups plus 
260         authentication from a domain controller use something like the 
261         following setup. This was tested on an early Red Hat Linux box.
262         </para>
263
264         <para>In <filename>/etc/nsswitch.conf</filename> put the 
265         following:
266 <programlisting>
267 passwd: files winbind
268 group:  files winbind
269 </programlisting>
270         </para>  
271
272         <para>In <filename>/etc/pam.d/*</filename> replace the <parameter>
273         auth</parameter> lines with something like this:
274 <programlisting>
275 auth  required    /lib/security/pam_securetty.so
276 auth  required    /lib/security/pam_nologin.so
277 auth  sufficient  /lib/security/pam_winbind.so
278 auth  required    /lib/security/pam_unix.so \
279                   use_first_pass shadow nullok
280 </programlisting>
281         </para>
282   
283         <note><para>
284         The PAM module pam_unix has recently replaced the module pam_pwdb.
285         Some Linux systems use the module pam_unix2 in place of pam_unix.
286         </para></note>
287
288         <para>Note in particular the use of the <parameter>sufficient
289         </parameter> keyword and the <parameter>use_first_pass</parameter> keyword. </para>
290
291         <para>Now replace the account lines with this: </para> 
292         
293         <para><command>account    required      /lib/security/pam_winbind.so
294         </command></para>
295  
296         <para>The next step is to join the domain. To do that use the 
297         <command>net</command> program like this:  </para>
298  
299         <para><command>net join -S PDC -U Administrator</command></para>
300  
301         <para>The username after the <parameter>-U</parameter> can be any
302         Domain user that has administrator privileges on the machine.
303         Substitute the name or IP of your PDC for "PDC".</para>
304
305         <para>Next copy <filename>libnss_winbind.so</filename> to 
306         <filename>/lib</filename> and <filename>pam_winbind.so
307         </filename> to <filename>/lib/security</filename>.  A symbolic link needs to be
308         made from <filename>/lib/libnss_winbind.so</filename> to
309         <filename>/lib/libnss_winbind.so.2</filename>.  If you are using an
310         older version of glibc then the target of the link should be
311         <filename>/lib/libnss_winbind.so.1</filename>.</para>
312
313         <para>Finally, setup a <citerefentry><refentrytitle>smb.conf</refentrytitle>
314         <manvolnum>5</manvolnum></citerefentry> containing directives like the 
315         following:
316 <programlisting>
317 [global]
318         winbind separator = +
319         winbind cache time = 10
320         template shell = /bin/bash
321         template homedir = /home/%D/%U
322         idmap uid = 10000-20000
323         idmap gid = 10000-20000
324         workgroup = DOMAIN
325         security = domain
326         password server = *
327 </programlisting></para>
328   
329
330         <para>Now start winbindd and you should find that your user and 
331         group database is expanded to include your NT users and groups, 
332         and that you can login to your unix box as a domain user, using 
333         the DOMAIN+user syntax for the username. You may wish to use the 
334         commands <command>getent passwd</command> and <command>getent group
335         </command> to confirm the correct operation of winbindd.</para>
336 </refsect1>
337
338
339 <refsect1>
340         <title>NOTES</title>
341
342         <para>The following notes are useful when configuring and 
343         running <command>winbindd</command>: </para>
344
345         <para><citerefentry><refentrytitle>nmbd</refentrytitle>
346         <manvolnum>8</manvolnum></citerefentry> must be running on the local machine 
347         for <command>winbindd</command> to work. </para>
348
349         <para>PAM is really easy to misconfigure.  Make sure you know what 
350         you are doing when modifying PAM configuration files.  It is possible 
351         to set up PAM such that you can no longer log into your system. </para>
352         
353         <para>If more than one UNIX machine is running <command>winbindd</command>, 
354         then in general the user and groups ids allocated by winbindd will not 
355         be the same.  The user and group ids will only be valid for the local 
356         machine, unless a shared <smbconfoption><name>idmap
357         backend</name></smbconfoption> is configured.</para>
358
359         <para>If the the Windows NT SID to UNIX user and group id mapping 
360         file is damaged or destroyed then the mappings will be lost. </para>
361 </refsect1>
362
363
364 <refsect1>
365         <title>SIGNALS</title>
366
367         <para>The following signals can be used to manipulate the 
368         <command>winbindd</command> daemon. </para>
369
370         <variablelist>
371                 <varlistentry>
372                 <term>SIGHUP</term>
373                 <listitem><para>Reload the <citerefentry><refentrytitle>smb.conf</refentrytitle>
374                 <manvolnum>5</manvolnum></citerefentry> file and 
375                 apply any parameter changes to the running 
376                 version of winbindd.  This signal also clears any cached 
377                 user and group information.  The list of other domains trusted 
378                 by winbindd is also reloaded.  </para></listitem>
379                 </varlistentry>
380
381                 <varlistentry>
382                 <term>SIGUSR2</term>
383                 <listitem><para>The SIGUSR2 signal will cause <command>
384                 winbindd</command> to write status information to the winbind 
385                 log file.</para>
386
387                 <para>Log files are stored in the filename specified by the 
388                 log file parameter.</para></listitem>
389                 </varlistentry>
390         </variablelist>
391 </refsect1>
392
393 <refsect1>
394         <title>FILES</title>
395
396         <variablelist>
397                 <varlistentry>
398                 <term><filename>/etc/nsswitch.conf(5)</filename></term>
399                 <listitem><para>Name service switch configuration file.</para>
400                 </listitem>
401                 </varlistentry>
402         
403                 <varlistentry>
404                 <term>/tmp/.winbindd/pipe</term>
405                 <listitem><para>The UNIX pipe over which clients communicate with 
406                 the <command>winbindd</command> program.  For security reasons, the 
407                 winbind client will only attempt to connect to the winbindd daemon 
408                 if both the <filename>/tmp/.winbindd</filename> directory
409                 and <filename>/tmp/.winbindd/pipe</filename> file are owned by 
410                 root. </para></listitem>
411                 </varlistentry>
412
413                 <varlistentry>
414                 <term>$LOCKDIR/winbindd_privileged/pipe</term>
415                 <listitem><para>The UNIX pipe over which 'privileged' clients 
416                 communicate with the <command>winbindd</command> program.  For security 
417                 reasons, access to some winbindd functions - like those needed by 
418                 the <command>ntlm_auth</command> utility - is restricted.  By default,
419                 only users in the 'root' group will get this access, however the administrator
420                 may change the group permissions on $LOCKDIR/winbindd_privileged to allow
421                 programs like 'squid' to use ntlm_auth.
422                 Note that the winbind client will only attempt to connect to the winbindd daemon 
423                 if both the <filename>$LOCKDIR/winbindd_privileged</filename> directory
424                 and <filename>$LOCKDIR/winbindd_privileged/pipe</filename> file are owned by 
425                 root. </para></listitem>
426                 </varlistentry>
427
428                 <varlistentry>
429                 <term>/lib/libnss_winbind.so.X</term>
430                 <listitem><para>Implementation of name service switch library.
431                 </para></listitem>
432                 </varlistentry>
433         
434                 <varlistentry>
435                 <term>$LOCKDIR/winbindd_idmap.tdb</term>
436                 <listitem><para>Storage for the Windows NT rid to UNIX user/group 
437                 id mapping.  The lock directory is specified when Samba is initially 
438                 compiled using the <parameter>--with-lockdir</parameter> option.
439                 This directory is by default <filename>/usr/local/samba/var/locks
440                 </filename>. </para></listitem>
441                 </varlistentry>
442         
443                 <varlistentry>
444                 <term>$LOCKDIR/winbindd_cache.tdb</term>
445                 <listitem><para>Storage for cached user and group information.
446                 </para></listitem>
447                 </varlistentry>
448         </variablelist>
449 </refsect1>
450
451
452 <refsect1>
453         <title>VERSION</title>
454
455         <para>This man page is correct for version 3.0 of
456         the Samba suite.</para>
457 </refsect1>
458
459 <refsect1>
460         <title>SEE ALSO</title>
461         
462         <para><filename>nsswitch.conf(5)</filename>, <citerefentry>
463         <refentrytitle>samba</refentrytitle>
464         <manvolnum>7</manvolnum></citerefentry>, <citerefentry>
465         <refentrytitle>wbinfo</refentrytitle>
466         <manvolnum>1</manvolnum></citerefentry>, <citerefentry>
467         <refentrytitle>ntlm_auth</refentrytitle>
468         <manvolnum>8</manvolnum></citerefentry>, <citerefentry>
469         <refentrytitle>smb.conf</refentrytitle>
470         <manvolnum>5</manvolnum></citerefentry>, <citerefentry>
471         <refentrytitle>pam_winbind</refentrytitle>
472         <manvolnum>8</manvolnum></citerefentry></para>
473 </refsect1>
474
475 <refsect1>
476         <title>AUTHOR</title>
477         
478         <para>The original Samba software and related utilities 
479         were created by Andrew Tridgell. Samba is now developed
480         by the Samba Team as an Open Source project similar 
481         to the way the Linux kernel is developed.</para>
482         
483         <para><command>wbinfo</command> and <command>winbindd</command> were 
484         written by Tim Potter.</para>
485         
486         <para>The conversion to DocBook for Samba 2.2 was done 
487         by Gerald Carter. The conversion to DocBook XML 4.2 for
488         Samba 3.0 was done by Alexander Bokovoy.</para>
489 </refsect1>
490
491 </refentry>