1 .\" This manpage has been automatically generated by docbook2man-spec
2 .\" from a DocBook document. docbook2man-spec can be found at:
3 .\" <http://shell.ipoline.com/~elmert/hacks/docbook2X/>
4 .\" Please send any bug reports, improvements, comments, patches,
5 .\" etc. to Steve Cheng <steve@ggi-project.org>.
6 .TH "SMBD" "8" "24 April 2001" "" ""
8 smbd \- server to provide SMB/CIFS services to clients
11 \fBsmbd\fR [ \fB-D\fR ] [ \fB-a\fR ] [ \fB-o\fR ] [ \fB-P\fR ] [ \fB-h\fR ] [ \fB-V\fR ] [ \fB-d <debug level>\fR ] [ \fB-l <log file>\fR ] [ \fB-p <port number>\fR ] [ \fB-O <socket option>\fR ] [ \fB-s <configuration file>\fR ]
14 This program is part of the Samba suite.
16 \fBsmbd\fR is the server daemon that
17 provides filesharing and printing services to Windows clients.
18 The server provides filespace and printer services to
19 clients using the SMB (or CIFS) protocol. This is compatible
20 with the LanManager protocol, and can service LanManager
21 clients. These include MSCLIENT 3.0 for DOS, Windows for
22 Workgroups, Windows 95/98/ME, Windows NT, Windows 2000,
23 OS/2, DAVE for Macintosh, and smbfs for Linux.
25 An extensive description of the services that the
26 server can provide is given in the man page for the
27 configuration file controlling the attributes of those
28 services (see \fIsmb.conf(5)
29 \fR. This man page will not describe the
30 services, but will concentrate on the administrative aspects
31 of running the server.
33 Please note that there are significant security
34 implications to running this server, and the \fIsmb.conf(5)\fRmanpage should be regarded as mandatory reading before
35 proceeding with installation.
37 A session is created whenever a client requests one.
38 Each client gets a copy of the server for each session. This
39 copy then services all connections made by the client during
40 that session. When all connections from its client are closed,
41 the copy of the server for that client terminates.
43 The configuration file, and any files that it includes,
44 are automatically reloaded every minute, if they change. You
45 can force a reload by sending a SIGHUP to the server. Reloading
46 the configuration file will not affect connections to any service
47 that is already established. Either the user will have to
48 disconnect from the service, or smbd killed and restarted.
52 If specified, this parameter causes
53 the server to operate as a daemon. That is, it detaches
54 itself and runs in the background, fielding requests
55 on the appropriate port. Operating the server as a
56 daemon is the recommended way of running smbd for
57 servers that provide more than casual use file and
58 print services. This switch is assumed is \fBsmbd
59 \fRis executed on the command line of a shell.
62 If this parameter is specified, each new
63 connection will append log messages to the log file.
67 If this parameter is specified, the
68 log files will be overwritten when opened. By default,
69 \fBsmbd\fR will append entries to the log
73 Passive option. Causes smbd not to
74 send any network traffic out. Used for debugging by
78 Prints the help information (usage)
82 Prints the version number for
85 \fB-d <debug level>\fR
86 debuglevel is an integer
87 from 0 to 10. The default value if this parameter is
88 not specified is zero.
90 The higher this value, the more detail will be
91 logged to the log files about the activities of the
92 server. At level 0, only critical errors and serious
93 warnings will be logged. Level 1 is a reasonable level for
94 day to day running - it generates a small amount of
95 information about operations carried out.
97 Levels above 1 will generate considerable
98 amounts of log data, and should only be used when
99 investigating a problem. Levels above 3 are designed for
100 use only by developers and generate HUGE amounts of log
101 data, most of which is extremely cryptic.
103 Note that specifying this parameter here will
108 If specified, \fBlog file\fR
109 specifies a log filename into which informational and debug
110 messages from the running server will be logged. The log
111 file generated is never removed by the server although
112 its size may be controlled by the max log sizeoption in the \fI smb.conf(5)\fRfile. The default log
113 file name is specified at compile time.
115 \fB-O <socket options>\fR
116 See the socket optionsparameter in the \fIsmb.conf(5)
119 \fB-p <port number>\fR
120 port number is a positive integer
121 value. The default value if this parameter is not
124 This number is the port number that will be
125 used when making connections to the server from client
126 software. The standard (well-known) port number for the
127 SMB over TCP is 139, hence the default. If you wish to
128 run the server as an ordinary user rather than
129 as root, most systems will require you to use a port
130 number greater than 1024 - ask your system administrator
131 for help if you are in this situation.
133 In order for the server to be useful by most
134 clients, should you configure it on a port other
135 than 139, you will require port redirection services
136 on port 139, details of which are outlined in rfc1002.txt
139 This parameter is not normally specified except
140 in the above situation.
142 \fB-s <configuration file>\fR
143 The file specified contains the
144 configuration details required by the server. The
145 information in this file includes server-specific
146 information such as what printcap file to use, as well
147 as descriptions of all the services that the server is
148 to provide. See \fI smb.conf(5)\fRfor more information.
149 The default configuration file name is determined at
153 \fB\fI/etc/inetd.conf\fB\fR
154 If the server is to be run by the
155 \fBinetd\fR meta-daemon, this file
156 must contain suitable startup information for the
157 meta-daemon. See the section INSTALLATION below.
160 or whatever initialization script your
163 If running the server as a daemon at startup,
164 this file will need to contain an appropriate startup
165 sequence for the server. See the section INSTALLATION
168 \fB\fI/etc/services\fB\fR
169 If running the server via the
170 meta-daemon \fBinetd\fR, this file
171 must contain a mapping of service name (e.g., netbios-ssn)
172 to service port (e.g., 139) and protocol type (e.g., tcp).
173 See the section INSTALLATION below.
175 \fB\fI/usr/local/samba/lib/smb.conf\fB\fR
176 This is the default location of the
177 \fIsmb.conf\fRserver configuration file. Other common places that systems
178 install this file are \fI/usr/samba/lib/smb.conf\fR
179 and \fI/etc/smb.conf\fR.
181 This file describes all the services the server
182 is to make available to clients. See \fIsmb.conf(5)\fRfor more information.
185 On some systems \fBsmbd\fR cannot change uid back
186 to root after a setuid() call. Such systems are called
187 trapdoor uid systems. If you have such a system,
188 you will be unable to connect from a client (such as a PC) as
189 two different users at once. Attempts to connect the
190 second user will result in access denied or
192 .SH "ENVIRONMENTVARIABLES"
195 If no printer name is specified to
196 printable services, most systems will use the value of
197 this variable (or lp if this variable is
198 not defined) as the name of the printer to use. This
199 is not specific to the server, however.
202 The location of the server and its support files
203 is a matter for individual system administrators. The following
204 are thus suggestions only.
206 It is recommended that the server software be installed
207 under the \fI/usr/local/samba/\fR hierarchy,
208 in a directory readable by all, writeable only by root. The server
209 program itself should be executable by all, as users may wish to
210 run the server themselves (in which case it will of course run
211 with their privileges). The server should NOT be setuid. On some
212 systems it may be worthwhile to make smbd setgid to an empty group.
213 This is because some systems may have a security hole where daemon
214 processes that become a user can be attached to with a debugger.
215 Making the smbd file setgid to an empty group may prevent
216 this hole from being exploited. This security hole and the suggested
217 fix has only been confirmed on old versions (pre-kernel 2.0) of Linux
218 at the time this was written. It is possible that this hole only
219 exists in Linux, as testing on other systems has thus far shown them
222 The server log files should be put in a directory readable and
223 writeable only by root, as the log files may contain sensitive
226 The configuration file should be placed in a directory
227 readable and writeable only by root, as the configuration file
228 controls security for the services offered by the server. The
229 configuration file can be made readable by all if desired, but
230 this is not necessary for correct operation of the server and is
231 not recommended. A sample configuration file \fIsmb.conf.sample
232 \fRis supplied with the source to the server - this may
233 be renamed to \fIsmb.conf\fR and modified to suit
236 The remaining notes will assume the following:
239 \fBsmbd\fR (the server program)
240 installed in \fI/usr/local/samba/bin\fR
243 \fIsmb.conf\fR (the configuration
244 file) installed in \fI/usr/local/samba/lib\fR
247 log files stored in \fI/var/adm/smblogs
249 The server may be run either as a daemon by users
250 or at startup, or it may be run from a meta-daemon such as
251 \fBinetd\fR upon request. If run as a daemon,
252 the server will always be ready, so starting sessions will be
253 faster. If run from a meta-daemon some memory will be saved and
254 utilities such as the tcpd TCP-wrapper may be used for extra
255 security. For serious use as file server it is recommended
256 that \fBsmbd\fR be run as a daemon.
259 When you've decided, continue with either
263 RUNNING THE SERVER AS A DAEMON or
266 RUNNING THE SERVER ON REQUEST.
267 .SH "RUNNING THE SERVER AS A DAEMON"
269 To run the server as a daemon from the command
270 line, simply put the \fB-D\fR option on the
271 command line. There is no need to place an ampersand at
272 the end of the command line - the \fB-D\fR
273 option causes the server to detach itself from the tty
276 Any user can run the server as a daemon (execute
277 permissions permitting, of course). This is useful for
278 testing purposes, and may even be useful as a temporary
279 substitute for something like ftp. When run this way, however,
280 the server will only have the privileges of the user who ran
283 To ensure that the server is run as a daemon whenever
284 the machine is started, and to ensure that it runs as root
285 so that it can serve multiple clients, you will need to modify
286 the system startup files. Wherever appropriate (for example, in
287 \fI/etc/rc\fR), insert the following line,
288 substituting port number, log file location, configuration file
289 location and debug level as desired:
291 \fB/usr/local/samba/bin/smbd -D -l /var/adm/smblogs/log
292 -s /usr/local/samba/lib/smb.conf\fR
294 (The above should appear in your initialization script
295 as a single line. Depending on your terminal characteristics,
296 it may not appear that way in this man page. If the above appears
297 as more than one line, please treat any newlines or indentation
298 as a single space or TAB character.)
300 If the options used at compile time are appropriate for
301 your system, all parameters except \fB-D\fR may
302 be omitted. See the section OPTIONS above.
303 .SH "RUNNING THE SERVER ON REQUEST"
305 If your system uses a meta-daemon such as \fBinetd
306 \fR, you can arrange to have the smbd server started
307 whenever a process attempts to connect to it. This requires several
308 changes to the startup files on the host machine. If you are
309 experimenting as an ordinary user rather than as root, you will
310 need the assistance of your system administrator to modify the
313 You will probably want to set up the NetBIOS name server
315 the same time as \fBsmbd\fR. To do this refer to the
316 man page for \fBnmbd(8)\fR
319 First, ensure that a port is configured in the file
320 \fI/etc/services\fR. The well-known port 139
321 should be used if possible, though any port may be used.
323 Ensure that a line similar to the following is in
326 \fBnetbios-ssn 139/tcp\fR
328 Note for NIS/YP users - you may need to rebuild the
329 NIS service maps rather than alter your local \fI/etc/services
332 Next, put a suitable line in the file \fI/etc/inetd.conf
333 \fR(in the unlikely event that you are using a meta-daemon
334 other than inetd, you are on your own). Note that the first item
335 in this line matches the service name in \fI/etc/services
336 \fR\&. Substitute appropriate values for your system
337 in this line (see \fBinetd(8)\fR):
339 \fBnetbios-ssn stream tcp nowait root /usr/local/samba/bin/smbd
340 -d1 -l/var/adm/smblogs/log -s/usr/local/samba/lib/smb.conf\fR
342 (The above should appear in \fI/etc/inetd.conf\fR
343 as a single line. Depending on your terminal characteristics, it may
344 not appear that way in this man page. If the above appears as more
345 than one line, please treat any newlines or indentation as a single
346 space or TAB character.)
348 Note that there is no need to specify a port number here,
349 even if you are using a non-standard port number.
351 Lastly, edit the configuration file to provide suitable
352 services. To start with, the following two services should be
369 This will allow you to connect to your home directory
370 and print to any printer supported by the host (user privileges
372 .SH "TESTING THE INSTALLATION"
374 If running the server as a daemon, execute it before
375 proceeding. If using a meta-daemon, either restart the system
376 or kill and restart the meta-daemon. Some versions of
377 \fBinetd\fR will reread their configuration
378 tables if they receive a HUP signal.
380 If your machine's name is fred and your
381 name is mary, you should now be able to connect
382 to the service \fI\\\\fred\\mary\fR.
384 To properly test and experiment with the server, we
385 recommend using the \fBsmbclient\fR program (see
387 and also going through the steps outlined in the file
388 \fIDIAGNOSIS.txt\fR in the \fIdocs/\fR
389 directory of your Samba installation.
392 This man page is correct for version 2.2 of
396 Most diagnostics issued by the server are logged
397 in a specified log file. The log file name is specified
398 at compile time, but may be overridden on the command line.
400 The number and nature of diagnostics available depends
401 on the debug level used by the server. If you have problems, set
402 the debug level to 3 and peruse the log files.
404 Most messages are reasonably self-explanatory. Unfortunately,
405 at the time this man page was created, there are too many diagnostics
406 available in the source code to warrant describing each and every
407 diagnostic. At this stage your best bet is still to grep the
408 source code and inspect the conditions that gave rise to the
409 diagnostics you are seeing.
412 Sending the smbd a SIGHUP will cause it to
413 re-load its \fIsmb.conf\fR configuration
414 file within a short period of time.
416 To shut down a users smbd process it is recommended
417 that \fBSIGKILL (-9)\fR \fBNOT\fR
418 be used, except as a last resort, as this may leave the shared
419 memory area in an inconsistent state. The safe way to terminate
420 an smbd is to send it a SIGTERM (-15) signal and wait for
421 it to die on its own.
423 The debug log level of smbd may be raised by sending
424 it a SIGUSR1 (\fBkill -USR1 <smbd-pid>\fR)
425 and lowered by sending it a SIGUSR2 (\fBkill -USR2 <smbd-pid>
426 \fR). This is to allow transient problems to be diagnosed,
427 whilst still running at a normally low log level.
429 Note that as the signal handlers send a debug write,
430 they are not re-entrant in smbd. This you should wait until
431 smbd is in a state of waiting for an incoming smb before
432 issuing them. It is possible to make the signal handlers safe
433 by un-blocking the signals before the select call and re-blocking
434 them after, however this would affect performance.
437 hosts_access(5), \fBinetd(8)\fR,
441 \fR, and the Internet RFC's
442 \fIrfc1001.txt\fR, \fIrfc1002.txt\fR.
443 In addition the CIFS (formerly SMB) specification is available
444 as a link from the Web page
445 http://samba.org/cifs/ <URL:http://samba.org/cifs/>.
448 The original Samba software and related utilities
449 were created by Andrew Tridgell. Samba is now developed
450 by the Samba Team as an Open Source project similar
451 to the way the Linux kernel is developed.
453 The original Samba man pages were written by Karl Auer.
454 The man page sources were converted to YODL format (another
455 excellent piece of Open Source software, available at
456 ftp://ftp.icce.rug.nl/pub/unix/ <URL:ftp://ftp.icce.rug.nl/pub/unix/>) and updated for the Samba 2.0
457 release by Jeremy Allison. The conversion to DocBook for
458 Samba 2.2 was done by Gerald Carter