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