999cd5a6dbc3f47697bc3d3b7111933ba27e6dc7
[ddiss/samba.git] / docs / manpages-3 / smbd.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="smbd.8">
4
5 <refmeta>
6         <refentrytitle>smbd</refentrytitle>
7         <manvolnum>8</manvolnum>
8 </refmeta>
9
10
11 <refnamediv>
12         <refname>smbd</refname>
13         <refpurpose>server to provide SMB/CIFS services to clients</refpurpose>
14 </refnamediv>
15
16 <refsynopsisdiv>
17         <cmdsynopsis>
18                 <command>smbd</command>
19                 <arg choice="opt">-D</arg>
20                 <arg choice="opt">-F</arg>
21                 <arg choice="opt">-S</arg>
22                 <arg choice="opt">-i</arg>
23                 <arg choice="opt">-h</arg>
24                 <arg choice="opt">-V</arg>
25                 <arg choice="opt">-b</arg>
26                 <arg choice="opt">-d &lt;debug level&gt;</arg>
27                 <arg choice="opt">-l &lt;log directory&gt;</arg>
28                 <arg choice="opt">-p &lt;port number(s)&gt;</arg>
29                 <arg choice="opt">-P &lt;profiling level&gt;</arg>
30                 <arg choice="opt">-O &lt;socket option&gt;</arg>
31                 <arg choice="opt">-s &lt;configuration file&gt;</arg>
32         </cmdsynopsis>
33 </refsynopsisdiv>
34
35 <refsect1>
36         <title>DESCRIPTION</title>
37         <para>This program is part of the <citerefentry><refentrytitle>samba</refentrytitle>
38         <manvolnum>7</manvolnum></citerefentry> suite.</para>
39
40         <para><command>smbd</command> is the server daemon that 
41         provides filesharing and printing services to Windows clients. 
42         The server provides filespace and printer services to
43         clients using the SMB (or CIFS) protocol. This is compatible 
44         with the LanManager protocol, and can service LanManager 
45         clients.  These include MSCLIENT 3.0 for DOS, Windows for 
46         Workgroups, Windows 95/98/ME, Windows NT, Windows 2000, 
47         OS/2, DAVE for Macintosh, and smbfs for Linux.</para>
48
49         <para>An extensive description of the services that the 
50         server can provide is given in the man page for the 
51         configuration file controlling the attributes of those 
52         services (see <citerefentry><refentrytitle>smb.conf</refentrytitle>
53         <manvolnum>5</manvolnum></citerefentry>.  This man page will not describe the 
54         services, but will concentrate on the administrative aspects 
55         of running the server.</para>
56
57         <para>Please note that there are significant security 
58         implications to running this server, and the <citerefentry><refentrytitle>smb.conf</refentrytitle>
59         <manvolnum>5</manvolnum></citerefentry> manual page should be regarded as mandatory reading before 
60         proceeding with installation.</para>
61
62         <para>A session is created whenever a client requests one. 
63         Each client gets a copy of the server for each session. This 
64         copy then services all connections made by the client during 
65         that session. When all connections from its client are closed, 
66         the copy of the server for that client terminates.</para>
67
68         <para>The configuration file, and any files that it includes, 
69         are automatically reloaded every minute, if they change.  You 
70         can force a reload by sending a SIGHUP to the server.  Reloading 
71         the configuration file will not affect connections to any service 
72         that is already established.  Either the user will have to 
73         disconnect from the service, or <command>smbd</command> killed and restarted.</para>
74 </refsect1>
75
76 <refsect1>
77         <title>OPTIONS</title>
78
79         <variablelist>
80                 <varlistentry>
81                 <term>-D</term>
82                 <listitem><para>If specified, this parameter causes 
83                 the server to operate as a daemon. That is, it detaches 
84                 itself and runs in the background, fielding requests 
85                 on the appropriate port. Operating the server as a
86                 daemon is the recommended way of running <command>smbd</command> for 
87                 servers that provide more than casual use file and 
88                 print services.  This switch is assumed if <command>smbd
89                 </command> is executed on the command line of a shell.
90                 </para></listitem>
91                 </varlistentry>
92
93                 <varlistentry>
94                 <term>-F</term>
95                 <listitem><para>If specified, this parameter causes
96                 the main <command>smbd</command> process to not daemonize,
97                 i.e. double-fork and disassociate with the terminal.
98                 Child processes are still created as normal to service
99                 each connection request, but the main process does not
100                 exit. This operation mode is suitable for running
101                 <command>smbd</command> under process supervisors such
102                 as <command>supervise</command> and <command>svscan</command>
103                 from Daniel J. Bernstein's <command>daemontools</command>
104                 package, or the AIX process monitor.
105                 </para></listitem>
106                 </varlistentry>
107
108                 <varlistentry>
109                 <term>-S</term>
110                 <listitem><para>If specified, this parameter causes
111                 <command>smbd</command> to log to standard output rather
112                 than a file.</para></listitem>
113                 </varlistentry>
114
115                 <varlistentry>
116                 <term>-i</term>
117                 <listitem><para>If this parameter is specified it causes the
118                 server to run "interactively", not as a daemon, even if the
119                 server is executed on the command line of a shell. Setting this
120                 parameter negates the implicit deamon mode when run from the
121                 command line. <command>smbd</command> also logs to standard
122                 output, as if the <command>-S</command> parameter had been
123                 given.
124                 </para></listitem>
125                 </varlistentry>
126                 
127                 &stdarg.server.debug;
128                 &popt.common.samba;
129                 &stdarg.help;
130
131                 <varlistentry>
132                 <term>-b</term>
133                 <listitem><para>Prints information about how 
134                 Samba was built.</para></listitem>
135                 </varlistentry>
136                 
137                 <varlistentry>
138                 <term>-p|--port&lt;port number(s)&gt;</term>
139                 <listitem><para><replaceable>port number(s)</replaceable> is a 
140                 space or comma-separated list of TCP ports smbd should listen on.
141                 The default value is taken from the <smbconfoption name="ports"/> parameter in &smb.conf;</para>
142
143                 <para>The default ports are 139 (used for SMB over NetBIOS over TCP)
144                         and port 445 (used for plain SMB over TCP).
145                 </para></listitem>
146                 </varlistentry>
147                 
148                 <varlistentry>
149                 <term>-P|--profiling-level&lt;profiling level&gt;</term>
150                 <listitem><para><replaceable>profiling level</replaceable> is a
151                 number specifying the level of profiling data to be collected.
152                 0 turns off profiling, 1 turns on counter profiling only,
153                 2 turns on complete profiling, and 3 resets all profiling data.
154                 </para></listitem>
155                 </varlistentry>
156         </variablelist>
157 </refsect1>
158
159 <refsect1>
160         <title>FILES</title>
161
162         <variablelist>
163                 <varlistentry>
164                 <term><filename>/etc/inetd.conf</filename></term>
165                 <listitem><para>If the server is to be run by the 
166                 <command>inetd</command> meta-daemon, this file 
167                 must contain suitable startup information for the 
168                 meta-daemon. 
169                 </para></listitem>
170                 </varlistentry>
171                 
172                 <varlistentry>
173                 <term><filename>/etc/rc</filename></term>
174                 <listitem><para>or whatever initialization script your 
175                 system uses).</para>
176
177                 <para>If running the server as a daemon at startup, 
178                 this file will need to contain an appropriate startup 
179                 sequence for the server. </para></listitem>
180                 </varlistentry>
181                 
182                 <varlistentry>
183                 <term><filename>/etc/services</filename></term>
184                 <listitem><para>If running the server via the 
185                 meta-daemon <command>inetd</command>, this file 
186                 must contain a mapping of service name (e.g., netbios-ssn) 
187                 to service port (e.g., 139) and protocol type (e.g., tcp). 
188                 </para></listitem>
189                 </varlistentry>
190                 
191                 <varlistentry>
192                 <term><filename>/usr/local/samba/lib/smb.conf</filename></term>
193                 <listitem><para>This is the default location of the <citerefentry><refentrytitle>smb.conf</refentrytitle>
194                 <manvolnum>5</manvolnum></citerefentry> server configuration file. Other common places that systems 
195                 install this file are <filename>/usr/samba/lib/smb.conf</filename> 
196                 and <filename>/etc/samba/smb.conf</filename>.</para>
197                 
198                 <para>This file describes all the services the server 
199                 is to make available to clients. See <citerefentry><refentrytitle>smb.conf</refentrytitle>
200                 <manvolnum>5</manvolnum></citerefentry> for more information.</para>
201                 </listitem>
202                 </varlistentry>
203         </variablelist>
204 </refsect1>
205
206 <refsect1>
207         <title>LIMITATIONS</title>
208         <para>On some systems <command>smbd</command> cannot change uid back 
209         to root after a setuid() call.  Such systems are called 
210         trapdoor uid systems. If you have such a system, 
211         you will be unable to connect from a client (such as a PC) as 
212         two different users at once. Attempts to connect the
213         second user will result in access denied or 
214         similar.</para>
215 </refsect1>
216
217 <refsect1>
218         <title>ENVIRONMENT VARIABLES</title>
219
220         <variablelist>
221                 <varlistentry>
222                 <term><envar>PRINTER</envar></term>
223                 <listitem><para>If no printer name is specified to 
224                 printable services, most systems will use the value of 
225                 this variable (or <constant>lp</constant> if this variable is 
226                 not defined) as the name of the printer to use. This 
227                 is not specific to the server, however.</para></listitem>
228                 </varlistentry>
229         </variablelist>
230 </refsect1>
231
232
233 <refsect1>
234         <title>PAM INTERACTION</title>
235         <para>Samba uses PAM for authentication (when presented with a plaintext 
236         password), for account checking (is this account disabled?) and for
237         session management.  The degree too which samba supports PAM is restricted
238         by the limitations of the SMB protocol and the <smbconfoption name="obey pam restrictions"/> <citerefentry><refentrytitle>smb.conf</refentrytitle>
239         <manvolnum>5</manvolnum></citerefentry> paramater.  When this is set, the following restrictions apply:
240         </para>
241
242         <itemizedlist>
243         <listitem><para><emphasis>Account Validation</emphasis>:  All accesses to a 
244         samba server are checked 
245         against PAM to see if the account is vaild, not disabled and is permitted to 
246         login at this time.  This also applies to encrypted logins.
247         </para></listitem>
248
249         <listitem><para><emphasis>Session Management</emphasis>:  When not using share 
250         level secuirty, users must pass PAM's session checks before access 
251         is granted.  Note however, that this is bypassed in share level secuirty.  
252         Note also that some older pam configuration files may need a line 
253         added for session support. 
254         </para></listitem>
255         </itemizedlist>
256 </refsect1>
257
258 <refsect1>
259         <title>VERSION</title>
260
261         <para>This man page is correct for version 3.0 of 
262         the Samba suite.</para>
263 </refsect1>
264
265 <refsect1>
266         <title>DIAGNOSTICS</title>
267
268         <para>Most diagnostics issued by the server are logged 
269         in a specified log file. The log file name is specified 
270         at compile time, but may be overridden on the command line.</para>
271
272         <para>The number and nature of diagnostics available depends 
273         on the debug level used by the server. If you have problems, set 
274         the debug level to 3 and peruse the log files.</para>
275
276         <para>Most messages are reasonably self-explanatory. Unfortunately, 
277         at the time this man page was created, there are too many diagnostics 
278         available in the source code to warrant describing each and every 
279         diagnostic. At this stage your best bet is still to grep the 
280         source code and inspect the conditions that gave rise to the 
281         diagnostics you are seeing.</para>
282 </refsect1>
283
284 <refsect1>
285         <title>TDB FILES</title>
286
287         <para>Samba stores it's data in several TDB (Trivial Database) files, usually located in <filename>/var/lib/samba</filename>.</para>
288         
289         <para>
290         (*) information persistent across restarts (but not
291         necessarily important to backup).
292         </para>
293
294 <variablelist>
295 <varlistentry><term>account_policy.tdb*</term>
296 <listitem>
297 <para>NT account policy settings such as pw expiration, etc...</para>
298 </listitem>
299 </varlistentry>
300
301 <varlistentry><term>brlock.tdb</term>
302 <listitem><para>byte range locks</para></listitem>
303 </varlistentry>
304
305 <varlistentry><term>browse.dat</term>
306 <listitem><para>browse lists</para></listitem>
307 </varlistentry>
308
309 <varlistentry><term>connections.tdb</term>
310 <listitem><para>share connections (used to enforce max connections, etc...)</para></listitem>
311 </varlistentry>
312
313 <varlistentry><term>gencache.tdb</term>
314 <listitem><para>generic caching db</para></listitem>
315 </varlistentry>
316
317 <varlistentry><term>group_mapping.tdb*</term>
318 <listitem><para>group mapping information</para></listitem>
319 </varlistentry>
320
321 <varlistentry><term>locking.tdb</term>
322 <listitem><para>share modes &amp; oplocks</para></listitem>
323 </varlistentry>
324
325 <varlistentry><term>login_cache.tdb*</term>
326 <listitem><para>bad pw attempts</para></listitem>
327 </varlistentry>
328
329 <varlistentry><term>messages.tdb</term>
330 <listitem><para>Samba messaging system</para></listitem>
331 </varlistentry>
332
333 <varlistentry><term>netsamlogon_cache.tdb*</term>
334 <listitem><para>cache of user net_info_3 struct from net_samlogon() request (as a domain member)</para></listitem>
335 </varlistentry>
336
337 <varlistentry><term>ntdrivers.tdb*</term>
338 <listitem><para>installed printer drivers</para></listitem>
339 </varlistentry>
340
341 <varlistentry><term>ntforms.tdb*</term>
342 <listitem><para>installed printer forms</para></listitem>
343 </varlistentry>
344
345 <varlistentry><term>ntprinters.tdb*</term>
346 <listitem><para>installed printer information</para></listitem>
347 </varlistentry>
348
349 <varlistentry><term>printing/</term>
350 <listitem><para>directory containing tdb per print queue of cached lpq output</para></listitem>
351 </varlistentry>
352
353 <varlistentry><term>registry.tdb</term>
354 <listitem><para>Windows registry skeleton (connect via regedit.exe)</para></listitem>
355 </varlistentry>
356
357 <varlistentry><term>sessionid.tdb</term>
358 <listitem><para>session information (e.g. support for 'utmp = yes')</para></listitem>
359 </varlistentry>
360
361 <varlistentry><term>share_info.tdb*</term>
362 <listitem><para>share acls</para></listitem>
363 </varlistentry>
364
365 <varlistentry><term>winbindd_cache.tdb</term>
366 <listitem><para>winbindd's cache of user lists, etc...</para></listitem>
367 </varlistentry>
368
369 <varlistentry><term>winbindd_idmap.tdb*</term>
370 <listitem><para>winbindd's local idmap db</para></listitem>
371 </varlistentry>
372
373 <varlistentry><term>wins.dat*</term>
374 <listitem><para>wins database when 'wins support = yes'</para></listitem>
375 </varlistentry>
376
377 </variablelist>
378
379 </refsect1>
380
381 <refsect1>
382         <title>SIGNALS</title>
383
384         <para>Sending the <command>smbd</command> a SIGHUP will cause it to 
385         reload its <filename>smb.conf</filename> configuration 
386         file within a short period of time.</para>
387
388         <para>To shut down a user's <command>smbd</command> process it is recommended 
389         that <command>SIGKILL (-9)</command> <emphasis>NOT</emphasis> 
390         be used, except as a last resort, as this may leave the shared
391         memory area in an inconsistent state. The safe way to terminate 
392         an <command>smbd</command> is to send it a SIGTERM (-15) signal and wait for 
393         it to die on its own.</para>
394
395         <para>The debug log level of <command>smbd</command> may be raised
396         or lowered using <citerefentry><refentrytitle>smbcontrol</refentrytitle>
397         <manvolnum>1</manvolnum></citerefentry> program (SIGUSR[1|2] signals are no longer 
398         used since Samba 2.2). This is to allow transient problems to be diagnosed, 
399         whilst still running at a normally low log level.</para>
400
401         <para>Note that as the signal handlers send a debug write, 
402         they are not re-entrant in <command>smbd</command>. This you should wait until 
403         <command>smbd</command> is in a state of waiting for an incoming SMB before 
404         issuing them. It is possible to make the signal handlers safe 
405         by un-blocking the signals before the select call and re-blocking 
406         them after, however this would affect performance.</para>
407 </refsect1>
408
409 <refsect1>
410         <title>SEE ALSO</title>
411         <para><citerefentry><refentrytitle>hosts_access</refentrytitle>
412         <manvolnum>5</manvolnum></citerefentry>, <citerefentry><refentrytitle>inetd</refentrytitle>
413         <manvolnum>8</manvolnum></citerefentry>, <citerefentry><refentrytitle>nmbd</refentrytitle>
414         <manvolnum>8</manvolnum></citerefentry>, <citerefentry><refentrytitle>smb.conf</refentrytitle>
415         <manvolnum>5</manvolnum></citerefentry>, <citerefentry><refentrytitle>smbclient</refentrytitle>
416         <manvolnum>1</manvolnum></citerefentry>, <citerefentry><refentrytitle>testparm</refentrytitle>
417         <manvolnum>1</manvolnum></citerefentry>, <citerefentry><refentrytitle>testprns</refentrytitle>
418         <manvolnum>1</manvolnum></citerefentry>, and the 
419         Internet RFC's  <filename>rfc1001.txt</filename>, <filename>rfc1002.txt</filename>. 
420         In addition the CIFS (formerly SMB) specification is available 
421         as a link from the Web page <ulink noescape="1" url="http://samba.org/cifs/"> 
422         http://samba.org/cifs/</ulink>.</para>
423 </refsect1>
424
425 <refsect1>
426         <title>AUTHOR</title>
427         
428         <para>The original Samba software and related utilities 
429         were created by Andrew Tridgell. Samba is now developed
430         by the Samba Team as an Open Source project similar 
431         to the way the Linux kernel is developed.</para>
432         
433         <para>The original Samba man pages were written by Karl Auer. 
434         The man page sources were converted to YODL format (another 
435         excellent piece of Open Source software, available at <ulink url="ftp://ftp.icce.rug.nl/pub/unix/">
436         ftp://ftp.icce.rug.nl/pub/unix/</ulink>) and updated for the Samba 2.0 
437         release by Jeremy Allison.  The conversion to DocBook for 
438         Samba 2.2 was done by Gerald Carter. The conversion to DocBook XML 4.2 for
439         Samba 3.0 was done by Alexander Bokovoy.</para>
440 </refsect1>
441
442 </refentry>