1 .TH SMBD 8 "23 Nov 2000" "smbd 2.2.0-alpha1"
4 smbd \- server to provide SMB/CIFS services to clients
8 \fBsmbd\fP [-D] [-a] [-o] [-P] [-h] [-V] [-d debuglevel] [-l log file] [-p port number] [-O socket options] [-s configuration file]
12 This program is part of the \fBSamba\fP suite\&.
14 \fBsmbd\fP is the server daemon that provides filesharing and printing
16 Windows clients\&. The server provides filespace and printer services to
17 clients using the SMB (or CIFS) protocol\&. This is compatible with the
18 LanManager protocol, and can service LanManager clients\&. These
19 include MSCLIENT 3\&.0 for DOS, Windows for Workgroups, Windows 95,
20 Windows NT, OS/2, DAVE for Macintosh, and smbfs for Linux\&.
22 An extensive description of the services that the server can provide
23 is given in the man page for the configuration file controlling the
24 attributes of those services (see
25 \fBsmb\&.conf (5)\fP\&. This man page
26 will not describe the services, but will concentrate on the
27 administrative aspects of running the server\&.
29 Please note that there are significant security implications to
30 running this server, and the
31 \fBsmb\&.conf (5)\fP manpage should be
32 regarded as mandatory reading before proceeding with installation\&.
34 A session is created whenever a client requests one\&. Each client gets
35 a copy of the server for each session\&. This copy then services all
36 connections made by the client during that session\&. When all
37 connections from its client are closed, the copy of the server for
38 that client terminates\&.
40 The configuration file, and any files that it includes, are
41 automatically reloaded every minute, if they change\&. You can force a
42 reload by sending a SIGHUP to the server\&. Reloading the configuration
43 file will not affect connections to any service that is already
44 established\&. Either the user will have to disconnect from the
45 service, or smbd killed and restarted\&.
51 If specified, this parameter causes the server to operate as a
52 daemon\&. That is, it detaches itself and runs in the background,
53 fielding requests on the appropriate port\&. Operating the server as a
54 daemon is the recommended way of running smbd for servers that provide
55 more than casual use file and print services\&.
57 By default, the server will NOT operate as a daemon\&.
60 If this parameter is specified, each new connection will
61 append log messages to the log file\&. This is the default\&.
64 If this parameter is specified, the log files will be
65 overwritten when opened\&. By default, the log files will be appended
69 Passive option\&. Causes smbd not to send any network traffic
70 out\&. Used for debugging by the developers only\&.
73 Prints the help information (usage) for \fBsmbd\fP\&.
76 Prints the version number for \fBsmbd\fP\&.
78 .IP "\fB-d debuglevel\fP"
79 debuglevel is an integer from 0 to 10\&.
81 The default value if this parameter is not specified is zero\&.
83 The higher this value, the more detail will be logged to the log files
84 about the activities of the server\&. At level 0, only critical errors
85 and serious warnings will be logged\&. Level 1 is a reasonable level for
86 day to day running - it generates a small amount of information about
87 operations carried out\&.
89 Levels above 1 will generate considerable amounts of log data, and
90 should only be used when investigating a problem\&. Levels above 3 are
91 designed for use only by developers and generate HUGE amounts of log
92 data, most of which is extremely cryptic\&.
94 Note that specifying this parameter here will override the \fBlog
95 level\fP parameter in the \fBsmb\&.conf
98 .IP "\fB-l log file\fP"
99 If specified, \fIlog file\fP specifies
100 a log filename into which informational and debug messages from the
101 running server will be logged\&. The log file generated is never removed
102 by the server although its size may be controlled by the \fBmax
103 log size\fP option in the \fBsmb\&.conf
104 (5)\fP file\&. The default log file name is specified
107 .IP "\fB-O socket options\fP"
109 options\fP parameter in the
110 \fBsmb\&.conf (5)\fP file for details\&.
112 .IP "\fB-p port number\fP"
113 port number is a positive integer value\&. The
114 default value if this parameter is not specified is 139\&.
116 This number is the port number that will be used when making
117 connections to the server from client software\&. The standard
118 (well-known) port number for the SMB over TCP is 139, hence the
119 default\&. If you wish to run the server as an ordinary user rather than
120 as root, most systems will require you to use a port number greater
121 than 1024 - ask your system administrator for help if you are in this
124 In order for the server to be useful by most clients, should you
125 configure it on a port other than 139, you will require port
126 redirection services on port 139, details of which are outlined in
127 rfc1002\&.txt section 4\&.3\&.5\&.
129 This parameter is not normally specified except in the above
132 .IP "\fB-s configuration file\fP"
133 The file specified contains the configuration details required by the
134 server\&. The information in this file includes server-specific
135 information such as what printcap file to use, as well as descriptions
136 of all the services that the server is to provide\&. See \fBsmb\&.conf
137 (5)\fP for more information\&.
138 The default configuration file name is determined at compile time\&.
143 \fB/etc/inetd\&.conf\fP
145 If the server is to be run by the inetd meta-daemon, this file must
146 contain suitable startup information for the meta-daemon\&. See the
147 section INSTALLATION below\&.
151 (or whatever initialization script your system uses)\&.
153 If running the server as a daemon at startup, this file will need to
154 contain an appropriate startup sequence for the server\&. See the
155 section INSTALLATION below\&.
159 If running the server via the meta-daemon inetd, this file must
160 contain a mapping of service name (e\&.g\&., netbios-ssn) to service port
161 (e\&.g\&., 139) and protocol type (e\&.g\&., tcp)\&. See the section
162 INSTALLATION below\&.
164 \fB/usr/local/samba/lib/smb\&.conf\fP
166 This is the default location of the \fIsmb\&.conf\fP server configuration
167 file\&. Other common places that systems install this file are
168 \fI/usr/samba/lib/smb\&.conf\fP and \fI/etc/smb\&.conf\fP\&.
170 This file describes all the services the server is to make available
171 to clients\&. See \fBsmb\&.conf (5)\fP for more information\&.
175 On some systems \fBsmbd\fP cannot change uid back to root after a
176 setuid() call\&. Such systems are called "trapdoor" uid systems\&. If you
177 have such a system, you will be unable to connect from a client (such
178 as a PC) as two different users at once\&. Attempts to connect the
179 second user will result in "access denied" or similar\&.
181 .SH "ENVIRONMENT VARIABLES"
185 If no printer name is specified to printable services, most systems
186 will use the value of this variable (or "lp" if this variable is not
187 defined) as the name of the printer to use\&. This is not specific to
188 the server, however\&.
192 The location of the server and its support files is a matter for
193 individual system administrators\&. The following are thus suggestions
196 It is recommended that the server software be installed under the
197 /usr/local/samba hierarchy, in a directory readable by all, writeable
198 only by root\&. The server program itself should be executable by all,
199 as users may wish to run the server themselves (in which case it will
200 of course run with their privileges)\&. The server should NOT be
201 setuid\&. On some systems it may be worthwhile to make smbd setgid to an
202 empty group\&. This is because some systems may have a security hole
203 where daemon processes that become a user can be attached to with a
204 debugger\&. Making the smbd file setgid to an empty group may prevent
205 this hole from being exploited\&. This security hole and the suggested
206 fix has only been confirmed on old versions (pre-kernel 2\&.0) of Linux
207 at the time this was written\&. It is possible that this hole only
208 exists in Linux, as testing on other systems has thus far shown them
211 The server log files should be put in a directory readable and
212 writeable only by root, as the log files may contain sensitive
215 The configuration file should be placed in a directory readable and
216 writeable only by root, as the configuration file controls security for
217 the services offered by the server\&. The configuration file can be made
218 readable by all if desired, but this is not necessary for correct
219 operation of the server and is not recommended\&. A sample configuration
220 file "smb\&.conf\&.sample" is supplied with the source to the server -
221 this may be renamed to "smb\&.conf" and modified to suit your needs\&.
223 The remaining notes will assume the following:
227 \fBsmbd\fP (the server program) installed in /usr/local/samba/bin
230 \fBsmb\&.conf\fP (the configuration file) installed in /usr/local/samba/lib
233 log files stored in /var/adm/smblogs
236 The server may be run either as a daemon by users or at startup, or it
237 may be run from a meta-daemon such as inetd upon request\&. If run as a
238 daemon, the server will always be ready, so starting sessions will be
239 faster\&. If run from a meta-daemon some memory will be saved and
240 utilities such as the tcpd TCP-wrapper may be used for extra security\&.
241 For serious use as file server it is recommended that \fBsmbd\fP be run
244 When you\'ve decided, continue with either
245 RUNNING THE SERVER AS A DAEMON or
246 RUNNING THE SERVER ON REQUEST\&.
248 .SH "RUNNING THE SERVER AS A DAEMON"
250 To run the server as a daemon from the command line, simply put the
251 \fB-D\fP option on the command line\&. There is no need to place an
252 ampersand at the end of the command line - the \fB-D\fP option causes
253 the server to detach itself from the tty anyway\&.
255 Any user can run the server as a daemon (execute permissions
256 permitting, of course)\&. This is useful for testing purposes, and may
257 even be useful as a temporary substitute for something like ftp\&. When
258 run this way, however, the server will only have the privileges of the
261 To ensure that the server is run as a daemon whenever the machine is
262 started, and to ensure that it runs as root so that it can serve
263 multiple clients, you will need to modify the system startup
264 files\&. Wherever appropriate (for example, in /etc/rc), insert the
265 following line, substituting port number, log file location,
266 configuration file location and debug level as desired:
268 \f(CW/usr/local/samba/bin/smbd -D -l /var/adm/smblogs/log -s /usr/local/samba/lib/smb\&.conf\fP
270 (The above should appear in your initialization script as a single line\&.
271 Depending on your terminal characteristics, it may not appear that way in
272 this man page\&. If the above appears as more than one line, please treat any
273 newlines or indentation as a single space or TAB character\&.)
275 If the options used at compile time are appropriate for your system,
276 all parameters except \fB-D\fP may be
277 omitted\&. See the section OPTIONS above\&.
279 .SH "RUNNING THE SERVER ON REQUEST"
281 If your system uses a meta-daemon such as \fBinetd\fP, you can arrange to
282 have the smbd server started whenever a process attempts to connect to
283 it\&. This requires several changes to the startup files on the host
284 machine\&. If you are experimenting as an ordinary user rather than as
285 root, you will need the assistance of your system administrator to
286 modify the system files\&.
288 You will probably want to set up the NetBIOS name server \fBnmbd\fP at
289 the same time as \fBsmbd\fP\&. To do this refer to the man page for
292 First, ensure that a port is configured in the file \f(CW/etc/services\fP\&. The
293 well-known port 139 should be used if possible, though any port may be
296 Ensure that a line similar to the following is in \f(CW/etc/services\fP:
298 \f(CWnetbios-ssn 139/tcp\fP
300 Note for NIS/YP users - you may need to rebuild the NIS service maps
301 rather than alter your local \f(CW/etc/services file\fP\&.
303 Next, put a suitable line in the file \f(CW/etc/inetd\&.conf\fP (in the unlikely
304 event that you are using a meta-daemon other than inetd, you are on
305 your own)\&. Note that the first item in this line matches the service
306 name in \f(CW/etc/services\fP\&. Substitute appropriate values for your system
307 in this line (see \fBinetd (8)\fP):
309 \f(CWnetbios-ssn stream tcp nowait root /usr/local/samba/bin/smbd -d1 -l/var/adm/smblogs/log -s/usr/local/samba/lib/smb\&.conf\fP
311 (The above should appear in \f(CW/etc/inetd\&.conf\fP as a single
312 line\&. Depending on your terminal characteristics, it may not appear
313 that way in this man page\&. If the above appears as more than one
314 line, please treat any newlines or indentation as a single space or
317 Note that there is no need to specify a port number here, even if you
318 are using a non-standard port number\&.
320 Lastly, edit the configuration file to provide suitable services\&. To
321 start with, the following two services should be all you need:
342 This will allow you to connect to your home directory and print to any
343 printer supported by the host (user privileges permitting)\&.
345 .SH "TESTING THE INSTALLATION"
347 If running the server as a daemon, execute it before proceeding\&. If
348 using a meta-daemon, either restart the system or kill and restart the
349 meta-daemon\&. Some versions of inetd will reread their configuration
350 tables if they receive a HUP signal\&.
352 If your machine\'s name is "fred" and your name is "mary", you should
353 now be able to connect to the service \f(CW\e\efred\emary\fP\&.
355 To properly test and experiment with the server, we recommend using
356 the smbclient program (see
357 \fBsmbclient (1)\fP) and also going through
358 the steps outlined in the file \fIDIAGNOSIS\&.txt\fP in the \fIdocs/\fP
359 directory of your Samba installation\&.
363 This man page is correct for version 2\&.0 of the Samba suite\&.
367 Most diagnostics issued by the server are logged in a specified log
368 file\&. The log file name is specified at compile time, but may be
369 overridden on the command line\&.
371 The number and nature of diagnostics available depends on the debug
372 level used by the server\&. If you have problems, set the debug level to
373 3 and peruse the log files\&.
375 Most messages are reasonably self-explanatory\&. Unfortunately, at the time
376 this man page was created, there are too many diagnostics available
377 in the source code to warrant describing each and every diagnostic\&. At
378 this stage your best bet is still to grep the source code and inspect
379 the conditions that gave rise to the diagnostics you are seeing\&.
383 Sending the smbd a SIGHUP will cause it to re-load its smb\&.conf
384 configuration file within a short period of time\&.
386 To shut down a users smbd process it is recommended that SIGKILL (-9)
387 \fINOT\fP be used, except as a last resort, as this may leave the shared
388 memory area in an inconsistent state\&. The safe way to terminate an
389 smbd is to send it a SIGTERM (-15) signal and wait for it to die on
392 The debug log level of smbd may be raised
393 by sending it a SIGUSR1 \f(CW(kill -USR1 <smbd-pid>)\fP and lowered by
394 sending it a SIGUSR2 \f(CW(kill -USR2 <smbd-pid>)\fP\&. This is to allow
395 transient problems to be diagnosed, whilst still running at a normally
398 Note that as the signal handlers send a debug write, they are not
399 re-entrant in smbd\&. This you should wait until smbd is in a state of
400 waiting for an incoming smb before issuing them\&. It is possible to
401 make the signal handlers safe by un-blocking the signals before the
402 select call and re-blocking them after, however this would affect
407 \fBhosts_access (5)\fP, \fBinetd (8)\fP, \fBnmbd (8)\fP,
408 \fBsmb\&.conf (5)\fP, \fBsmbclient
409 (1)\fP, \fBtestparm (1)\fP,
410 \fBtestprns (1)\fP, and the Internet RFC\'s
411 \fBrfc1001\&.txt\fP, \fBrfc1002\&.txt\fP\&. In addition the CIFS (formerly SMB)
412 specification is available as a link from the Web page :
413 http://samba\&.org/cifs/\&.
417 The original Samba software and related utilities were created by
418 Andrew Tridgell samba@samba\&.org\&. Samba is now developed
419 by the Samba Team as an Open Source project similar to the way the
420 Linux kernel is developed\&.
422 The original Samba man pages were written by Karl Auer\&. The man page
423 sources were converted to YODL format (another excellent piece of Open
424 Source software, available at
425 \fBftp://ftp\&.icce\&.rug\&.nl/pub/unix/\fP)
426 and updated for the Samba2\&.0 release by Jeremy Allison\&.
429 See \fBsamba (7)\fP to find out how to get a full list of contributors
430 and details on how to submit bug reports, comments etc\&.