1 mailto(samba-bugs@samba.anu.edu.au)
3 manpage(smbd)(8)(23 Oct 1998)(Samba)(SAMBA)
6 manpagename(smbd)(server to provide SMB/CIFS services to clients)
11 bf(smbd) [-D] [-a] [-o] [-d debuglevel] [-l log file] [-p port number]
12 [-O socket options] [-s configuration file] [-i scope] [-P] [-h]
17 This program is part of the bf(Samba) suite.
19 bf(smbd) is the server daemon that provides filesharing services to
20 Windows clients. The server provides filespace and printer services to
21 clients using the SMB (or CIFS) protocol. This is compatible with the
22 LanManager protocol, and can service LanManager clients. These
23 include MSCLIENT 3.0 for DOS, Windows for Workgroups, Windows 95,
24 Windows NT, OS/2, DAVE for Macintosh, and smbfs for Linux.
26 An extensive description of the services that the server can provide
27 is given in the man page for the configuration file controlling the
28 attributes of those services (see bf(smb.conf (5))). This man page
29 will not describe the services, but will concentrate on the
30 administrative aspects of running the server.
32 Please note that there are significant security implications to
33 running this server, and the bf(smb.conf (5)) manpage should be
34 regarded as mandatory reading before proceeding with installation.
36 A session is created whenever a client requests one. Each client gets
37 a copy of the server for each session. This copy then services all
38 connections made by the client during that session. When all
39 connections from its client are are closed, the copy of the server for
40 that client terminates.
42 The configuration file, and any files that it includes, are
43 automatically reloaded every minute, if they change. You can force a
44 reload by sending a SIGHUP to the server. Reloading the configuration
45 file will not affect connections to any service that is already
46 established. Either the user will have to disconnect from the
47 service, or smbd killed and restarted.
54 dit(bf(-D)) If specified, this parameter causes the server to operate as a
55 daemon. That is, it detaches itself and runs in the background,
56 fielding requests on the appropriate port. Operating the server as a
57 daemon is the recommended way of running smbd for servers that provide
58 more than casual use file and print services.
60 By default, the server will NOT operate as a daemon.
62 dit(bf(-a)) If this parameter is specified, each new connection will
63 append log messages to the log file. This is the default.
65 dit(bf(-o)) If this parameter is specified, the log files will be
66 overwritten when opened. By default, the log files will be appended
69 dit(bf(-d debuglevel)) debuglevel is an integer from 0 to 10.
71 The default value if this parameter is not specified is zero.
73 The higher this value, the more detail will be logged to the log files
74 about the activities of the server. At level 0, only critical errors
75 and serious warnings will be logged. Level 1 is a reasonable level for
76 day to day running - it generates a small amount of information about
77 operations carried out.
79 Levels above 1 will generate considerable amounts of log data, and
80 should only be used when investigating a problem. Levels above 3 are
81 designed for use only by developers and generate HUGE amounts of log
82 data, most of which is extremely cryptic.
84 dit(bf(-l log file)) If specified, em(logfile) specifies a log filename
85 into which informational and debug messages from the running server
86 will be logged. The log file generated is never removed by the server
87 although its size may be controlled by an bf(smb.conf (5)) option.
88 The default log file name is specified at compile time.
90 dit(bf(-O socket options)) See the socket options section of bf(smb.conf
93 dit(bf(-p port number)) port number is a positive integer value. The
94 default value if this parameter is not specified is 139.
96 This number is the port number that will be used when making
97 connections to the server from client software. The standard
98 (well-known) port number for the SMB over TCP is 139, hence the
99 default. If you wish to run the server as an ordinary user rather than
100 as root, most systems will require you to use a port number greater
101 than 1024 - ask your system administrator for help if you are in this
104 In order for the server to be useful by most clients, should you
105 configure it on a port other than 139, you will require port
106 redirection services on port 139, details of which are outlined in
107 rfc1002.txt section 4.3.5.
109 This parameter is not normally specified except in the above
112 dit(bf(-s configuration file)) The default configuration file name is
113 determined at compile time.
115 The file specified contains the configuration details required by the
116 server. The information in this file includes server-specific
117 information such as what printcap file to use, as well as descriptions
118 of all the services that the server is to provide. See bf(smb.conf
119 (5)) for more information.
121 dit(bf(-i scope)) This specifies a NetBIOS scope that the server will use
122 to communicate with when generating NetBIOS names. For details on the
123 use of NetBIOS scopes, see rfc1001.txt and rfc1002.txt. NetBIOS scopes
124 are em(very) rarely used, only set this parameter if you are the
125 system administrator in charge of all the NetBIOS systems you
128 dit(bf(-h)) Prints the help information (usage) for smbd.
130 dit(bf(-P)) Passive option. Causes smbd not to send any network traffic
131 out. Used for debugging by the developers only.
140 If the server is to be run by the inetd meta-daemon, this file must
141 contain suitable startup information for the meta-daemon. See the
142 section em(INSTALLATION) below.
146 (or whatever initialisation script your system uses).
148 If running the server as a daemon at startup, this file will need to
149 contain an appropriate startup sequence for the server. See the
150 section em(INSTALLATION) below.
154 If running the server via the meta-daemon inetd, this file must
155 contain a mapping of service name (eg., netbios-ssn) to service port
156 (eg., 139) and protocol type (eg., tcp). See the section
157 em(INSTALLATION) below.
159 bf(/usr/local/samba/lib/smb.conf)
161 This is the default location of the em(smb.conf) server configuration
162 file. Other common places that systems install this file are
163 em(/usr/samba/lib/smb.conf) and em(/etc/smb.conf).
165 This file describes all the services the server is to make available
166 to clients. See bf(smb.conf (5)) for more information.
169 manpagesection(LIMITATIONS)
171 On some systems bf(smbd) cannot change uid back to root after a
172 setuid() call. Such systems are called "trapdoor" uid systems. If you
173 have such a system, you will be unable to connect from a client (such
174 as a PC) as two different users at once. Attempts to connect the
175 second user will result in "access denied" or similar.
177 label(ENVIRONMENTVARIABLES)
178 manpagesection(ENVIRONMENT VARIABLES)
182 If no printer name is specified to printable services, most systems
183 will use the value of this variable (or "lp" if this variable is not
184 defined) as the name of the printer to use. This is not specific to
188 manpagesection(INSTALLATION)
190 The location of the server and its support files is a matter for
191 individual system administrators. The following are thus suggestions
194 It is recommended that the server software be installed under the
195 /usr/local/samba hierarchy, in a directory readable by all, writeable
196 only by root. The server program itself should be executable by all,
197 as users may wish to run the server themselves (in which case it will
198 of course run with their privileges). The server should NOT be
199 setuid. On some systems it may be worthwhile to make smbd setgid to an
200 empty group. This is because some systems may have a security hole
201 where daemon processes that become a user can be attached to with a
202 debugger. Making the smbd file setgid to an empty group may prevent
203 this hole from being exploited. This security hole and the suggested
204 fix has only been confirmed on old versions (pre-kernel 2.0) of Linux
205 at the time this was written. It is possible that this hole only
206 exists in Linux, as testing on other systems has thus far shown them
209 The server log files should be put in a directory readable and
210 writable only by root, as the log files may contain sensitive
213 The configuration file should be placed in a directory readable and
214 writable only by root, as the configuration file controls security for
215 the services offered by the server. The configuration file can be made
216 readable by all if desired, but this is not necessary for correct
217 operation of the server and is not recommended. A sample configuration
218 file "smb.conf.sample" is supplied with the source to the server -
219 this may be renamed to "smb.conf" and modified to suit your needs.
221 The remaining notes will assume the following:
225 it() bf(smbd) (the server program) installed in /usr/local/samba/bin
227 it() bf(smb.conf) (the configuration file) installed in /usr/local/samba/lib
229 it() log files stored in /var/adm/smblogs
233 The server may be run either as a daemon by users or at startup, or it
234 may be run from a meta-daemon such as inetd upon request. If run as a
235 daemon, the server will always be ready, so starting sessions will be
236 faster. If run from a meta-daemon some memory will be saved and
237 utilities such as the tcpd TCP-wrapper may be used for extra security.
238 For serious use as file server it is recommended that bf(smbd) be run
241 When you've decided, continue with either em(RUNNING THE SERVER AS A
242 DAEMON) or em(RUNNING THE SERVER ON REQUEST).
244 label(RUNNINGTHESERVERASADAEMON)
245 manpagesection(RUNNING THE SERVER AS A DAEMON)
247 To run the server as a daemon from the command line, simply put the
248 bf(-D) option on the command line. There is no need to place an
249 ampersand at the end of the command line - the bf(-D) option causes
250 the server to detach itself from the tty anyway.
252 Any user can run the server as a daemon (execute permissions
253 permitting, of course). This is useful for testing purposes, and may
254 even be useful as a temporary substitute for something like ftp. When
255 run this way, however, the server will only have the privileges of the
258 To ensure that the server is run as a daemon whenever the machine is
259 started, and to ensure that it runs as root so that it can serve
260 multiple clients, you will need to modify the system startup
261 files. Wherever appropriate (for example, in /etc/rc), insert the
262 following line, substituting port number, log file location,
263 configuration file location and debug level as desired:
265 tt(/usr/local/samba/bin/smbd -D -l /var/adm/smblogs/log -s /usr/local/samba/lib/smb.conf)
267 (The above should appear in your initialisation script as a single line.
268 Depending on your terminal characteristics, it may not appear that way in
269 this man page. If the above appears as more than one line, please treat any
270 newlines or indentation as a single space or TAB character.)
272 If the options used at compile time are appropriate for your system,
273 all parameters except the desired debug level and bf(-D) may be
274 omitted. See the section em(OPTIONS) above.
276 label(RUNNINGTHESERVERONREQUEST)
277 manpagesection(RUNNING THE SERVER ON REQUEST)
279 If your system uses a meta-daemon such as inetd, you can arrange to
280 have the smbd server started whenever a process attempts to connect to
281 it. This requires several changes to the startup files on the host
282 machine. If you are experimenting as an ordinary user rather than as
283 root, you will need the assistance of your system administrator to
284 modify the system files.
286 You will probably want to set up the NetBIOS name server bf(nmbd) at
287 the same time as bf(smbd). To do this refer to the man page for
290 First, ensure that a port is configured in the file /etc/services. The
291 well-known port 139 should be used if possible, though any port may be
294 Ensure that a line similar to the following is in /etc/services:
296 tt(netbios-ssn 139/tcp)
298 Note for NIS/YP users - you may need to rebuild the NIS service maps
299 rather than alter your local /etc/services file.
301 Next, put a suitable line in the file /etc/inetd.conf (in the unlikely
302 event that you are using a meta-daemon other than inetd, you are on
303 your own). Note that the first item in this line matches the service
304 name in /etc/services. Substitute appropriate values for your system
305 in this line (see bf(inetd (8))):
307 tt(netbios-ssn stream tcp nowait root /usr/local/samba/bin/smbd -d1 -l/var/adm/smblogs/log -s/usr/local/samba/lib/smb.conf)
309 (The above should appear in /etc/inetd.conf as a single
310 line. Depending on your terminal characteristics, it may not appear
311 that way in this man page. If the above appears as more than one
312 line, please treat any newlines or indentation as a single space or
315 Note that there is no need to specify a port number here, even if you
316 are using a non-standard port number.
318 Lastly, edit the configuration file to provide suitable services. To
319 start with, the following two services should be all you need:
332 This will allow you to connect to your home directory and print to any
333 printer supported by the host (user privileges permitting).
335 label(TESTINGTHEINSTALLATION)
336 manpagesection(TESTING THE INSTALLATION)
338 If running the server as a daemon, execute it before proceeding. If
339 using a meta-daemon, either restart the system or kill and restart the
340 meta-daemon. Some versions of inetd will reread their configuration
341 tables if they receive a HUP signal.
343 If your machine's name is "fred" and your name is "mary", you should
344 now be able to connect to the service tt(\\fred\mary).
346 To properly test and experiment with the server, we recommend using
347 the smbclient program (see bf(smbclient (1))) and also going through
348 the steps outlined in the file em(DIAGNOSIS.txt) in the em(docs/)
349 directory of your Samba installation.
352 manpagesection(VERSION)
354 This man page is (mostly) correct for version 2.0 of the Samba suite,
355 plus some of the recent patches to it. These notes will necessarily
356 lag behind development of the software, so it is possible that your
357 version of the server has extensions or parameter semantics that
358 differ from or are not covered by this man page. Please notify these
359 to the address below for rectification.
362 manpagesection(DIAGNOSTICS)
364 Most diagnostics issued by the server are logged in a specified log
365 file. The log file name is specified at compile time, but may be
366 overridden on the command line.
368 The number and nature of diagnostics available depends on the debug
369 level used by the server. If you have problems, set the debug level to
370 3 and peruse the log files.
372 Most messages are reasonably self-explanatory. Unfortunately, at time
373 of creation of this man page there are too many diagnostics available
374 in the source code to warrant describing each and every diagnostic. At
375 this stage your best bet is still to grep the source code and inspect
376 the conditions that gave rise to the diagnostics you are seeing.
379 manpagesection(SIGNALS)
381 Sending the smbd a SIGHUP will cause it to re-load its smb.conf
382 configuration file within a short period of time.
384 To shut down a users smbd process it is recommended that SIGKILL (-9)
385 em(NOT) be used, except as a last resort, as this may leave the shared
386 memory area in an inconsistant state. The safe way to terminate an
387 smbd is to send it a SIGTERM (-15) signal and wait for it to die on
390 In version 1.9.18 and above the debug log level of smbd may be raised
391 by sending it a SIGUSR1 tt((kill -USR1 <smbd-pid>)) and lowered by
392 sending it a SIGUSR2 tt((kill -USR2 <smbd-pid>)). This is to allow
393 transient problems to be diagnosed, whilst still running at a normally
396 Note that as the signal handlers send a debug write, they are not
397 re-entrant in smbd. This you should wait until smbd is in a state of
398 waiting for an incoming smb before issuing them. It is possible to
399 make the signal handlers safe by un-blocking the signals before the
400 select call and re-blocking them after, however this would affect
406 bf(hosts_access (5)), bf(inetd (8)), url(bf(nmbd (8)))(nmbd.8.html),
407 url(bf(smb.conf (5)))(smb.conf.html), url(bf(smbclient
408 (1)))(smbclient.1.html), url(bf(testparm (1)))(testparm.1.html),
409 url(bf(testprns (1)))(testprns.1.html), and the Internet RFC's
410 bf(rfc1001.txt), bf(rfc1002.txt). In addition the CIFS (formerly SMB)
411 specification is available as a link from the Web page :
412 url(http://samba.anu.edu.au/cifs/)(http://samba.anu.edu.au/cifs/).
417 The original Samba software and related utilities were created by
418 Andrew Tridgell (samba-bugs@samba.anu.edu.au). 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 See url(bf(samba (7)))(samba.7.html) to find out how to get a full list of contributors
423 and details on how to submit bug reports, comments etc.