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