1 .TH SMBD 8 17/1/1995 smbd smbd
3 smbd \- provide SMB (aka LanManager) services to clients
27 This program is part of the Samba suite.
30 is a server that can provide most SMB services. The
31 server provides filespace and printer services to clients using the SMB
32 protocol. This is compatible with the LanManager protocol, and can
33 service LanManager clients.
35 An extensive description of the services that the server can provide is given
36 in the man page for the configuration file controlling the attributes of those
38 .B smb.conf(5)). This man page will not describe the services, but
39 will concentrate on the administrative aspects of running the server.
41 Please note that there are significant security implications to running this
43 .B smb.conf(5) should be regarded as mandatory reading before proceeding with
46 A session is created whenever a client requests one. Each client gets a copy
47 of the server for each session. This copy then services all connections made
48 by the client during that session. When all connections from its client are
49 are closed, the copy of the server for that client terminates.
51 The configuration file is automatically reloaded if it changes. You
52 can force a reload by sending a SIGHUP to the server.
58 If specified, this parameter causes the server to operate as a daemon. That is,
59 it detaches itself and runs in the background, fielding requests on the
62 By default, the server will NOT operate as a daemon.
68 If this parameter is specified, the log files will be overwritten with each
69 new connection. By default, the log files will be appended to.
76 debuglevel is an integer from 0 to 5.
78 The default value if this parameter is not specified is zero.
80 The higher this value, the more detail will be logged to the log files about
81 the activities of the server. At level 0, only critical errors and serious
82 warnings will be logged. Level 1 is a reasonable level for day to day running
83 - it generates a small amount of information about operations carried out.
85 Levels above 1 will generate considerable amounts of log data, and should
86 only be used when investigating a problem. Levels above 3 are designed for
87 use only by developers and generate HUGE amounts of log data, most of which
97 specifies a base filename into which operational data from the running server
100 The default base name is specified at compile time.
102 The base name is used to generate actual log file names. For example, if the
103 name specified was "log", the following files would be used for log data:
106 log.debug (containing debugging information)
108 log.in (containing inbound transaction data)
110 log.out (containing outbound transaction data)
113 The log files generated are never removed by the server.
120 See the socket options section of smb.conf(5) for details
127 port number is a positive integer value.
129 The default value if this parameter is not specified is 139.
131 This number is the port number that will be used when making connections to
132 the server from client software. The standard (well-known) port number for the
133 server is 139, hence the default. If you wish to run the server as an ordinary
134 user rather than as root, most systems will require you to use a port number
135 greater than 1024 - ask your system administrator for help if you are in this
138 This parameter is not normally specified except in the above situation.
142 .I configuration file
145 The default configuration file name is determined at compile time.
147 The file specified contains the configuration details required by the server.
148 The information in this file includes server-specific information such as
149 what printcap file to use, as well as descriptions of all the services that the
150 server is to provide. See
151 .B smb.conf(5) for more information.
159 If the server is to be run by the inetd meta-daemon, this file must contain
160 suitable startup information for the meta-daemon. See the section
161 "INSTALLATION" below.
167 (or whatever initialisation script your system uses)
169 If running the server as a daemon at startup, this file will need to contain
170 an appropriate startup sequence for the server. See the section "INSTALLATION"
177 If running the server via the meta-daemon inetd, this file must contain a
178 mapping of service name (eg., netbios-ssn) to service port (eg., 139) and
179 protocol type (eg., tcp). See the section "INSTALLATION" below.
182 .B /usr/local/smb/smb.conf
185 This file describes all the services the server is to make available to
187 .B smb.conf(5) for more information.
193 On some systems smbd cannot change uid back to root after a setuid() call.
194 Such systems are called "trapdoor" uid systems. If you have such a system,
195 you will be unable to connect from a client (such as a PC) as two different
196 users at once. Attempts to connect the second user will result in "access
199 .SH ENVIRONMENT VARIABLES
204 If no printer name is specified to printable services, most systems will
205 use the value of this variable (or "lp" if this variable is not defined)
206 as the name of the printer to use. This is not specific to the server,
211 The location of the server and its support files is a matter for individual
212 system administrators. The following are thus suggestions only.
214 It is recommended that the server software be installed under the
215 /usr/local hierarchy, in a directory readable by all, writeable only
216 by root. The server program itself should be executable by all, as
217 users may wish to run the server themselves (in which case it will of
218 course run with their privileges). The server should NOT be
219 setuid. On some systems it may be worthwhile to make smbd setgid to an
220 empty group. This is because some systems may have a security hole where
221 daemon processes that become a user can be attached to with a
222 debugger. Making the smbd file setgid to an empty group may prevent
223 this hole from being exploited. This secrity hole and the suggested
224 fix has only been confirmed on Linux at the time this was written. It
225 is possible that this hole only exists in Linux, as testing on other
226 systems has thus far shown them to be immune.
228 The server log files should be put in a directory readable and writable only
229 by root, as the log files may contain sensitive information.
231 The configuration file should be placed in a directory readable and writable
232 only by root, as the configuration file controls security for the services
233 offered by the server. The configuration file can be made readable by all if
234 desired, but this is not necessary for correct operation of the server and
235 is not recommended. A sample configuration file "smb.conf.sample" is supplied
236 with the source to the server - this may be renamed to "smb.conf" and
237 modified to suit your needs.
239 The remaining notes will assume the following:
242 smbd (the server program) installed in /usr/local/smb
244 smb.conf (the configuration file) installed in /usr/local/smb
246 log files stored in /var/adm/smblogs
249 The server may be run either as a daemon by users or at startup, or it may
250 be run from a meta-daemon such as inetd upon request. If run as a daemon, the
251 server will always be ready, so starting sessions will be faster. If run from
252 a meta-daemon some memory will be saved and utilities such as the tcpd
253 TCP-wrapper may be used for extra security.
255 When you've decided, continue with either "RUNNING THE SERVER AS A DAEMON" or
256 "RUNNING THE SERVER ON REQUEST".
257 .SH RUNNING THE SERVER AS A DAEMON
258 To run the server as a daemon from the command line, simply put the "-D" option
259 on the command line. There is no need to place an ampersand at the end of the
260 command line - the "-D" option causes the server to detach itself from the
263 Any user can run the server as a daemon (execute permissions permitting, of
264 course). This is useful for testing purposes, and may even be useful as a
265 temporary substitute for something like ftp. When run this way, however, the
266 server will only have the privileges of the user who ran it.
268 To ensure that the server is run as a daemon whenever the machine is started,
269 and to ensure that it runs as root so that it can serve multiple clients, you
270 will need to modify the system startup files. Wherever appropriate (for
271 example, in /etc/rc), insert the following line, substituting
272 port number, log file location, configuration file location and debug level as
276 /usr/local/smb/smbd -D -l /var/adm/smblogs/log -s /usr/local/smb/smb.conf
279 (The above should appear in your initialisation script as a single line.
280 Depending on your terminal characteristics, it may not appear that way in
281 this man page. If the above appears as more than one line, please treat any
282 newlines or indentation as a single space or TAB character.)
284 If the options used at compile time are appropriate for your system, all
285 parameters except the desired debug level and "-D" may be omitted. See the
286 section "OPTIONS" above.
287 .SH RUNNING THE SERVER ON REQUEST
288 If your system uses a meta-daemon such as inetd, you can arrange to have the
289 smbd server started whenever a process attempts to connect to it. This requires
290 several changes to the startup files on the host machine. If you are
291 experimenting as an ordinary user rather than as root, you will need the
292 assistance of your system administrator to modify the system files.
294 You will probably want to set up the name server
297 the smbd - refer to the man page
300 First, ensure that a port is configured in the file /etc/services. The
301 well-known port 139 should be used if possible, though any port may be used.
303 Ensure that a line similar to the following is in /etc/services:
309 Note for NIS/YP users - you may need to rebuild the NIS service maps rather
310 than alter your local /etc/services file.
312 Next, put a suitable line in the file /etc/inetd.conf (in the unlikely event
313 that you are using a meta-daemon other than inetd, you are on your own). Note
314 that the first item in this line matches the service name in /etc/services.
315 Substitute appropriate values for your system in this line (see
319 netbios-ssn stream tcp nowait root /usr/local/smb/smbd -d1
320 -l/var/adm/smblogs/log -s/usr/local/smb/smb.conf
323 (The above should appear in /etc/inetd.conf as a single line. Depending on
324 your terminal characteristics, it may not appear that way in this man page.
325 If the above appears as more than one line, please treat any newlines or
326 indentation as a single space or TAB character.)
328 Note that there is no need to specify a port number here, even if you are
329 using a non-standard port number.
331 Lastly, edit the configuration file to provide suitable services. To start
332 with, the following two services should be all you need:
349 This will allow you to connect to your home directory and print to any printer
350 supported by the host (user privileges permitting).
351 .SH TESTING THE INSTALLATION
352 If running the server as a daemon, execute it before proceeding. If
353 using a meta-daemon, either restart the system or kill and restart the
354 meta-daemon. Some versions of inetd will reread their configuration tables if
355 they receive a HUP signal.
357 If your machine's name is "fred" and your name is "mary", you should now be
358 able to connect to the service "\\\\fred\\mary".
360 To properly test and experiment with the server, we recommend using the
361 smbclient program (see
364 This man page is (mostly) correct for version 1.9.00 of the Samba suite, plus some
365 of the recent patches to it. These notes will necessarily lag behind
366 development of the software, so it is possible that your version of
367 the server has extensions or parameter semantics that differ from or are not
368 covered by this man page. Please notify these to the address below for
380 [This section under construction]
382 Most diagnostics issued by the server are logged in a specified log file. The
383 log file name is specified at compile time, but may be overridden on the
386 The number and nature of diagnostics available depends on the debug level used
387 by the server. If you have problems, set the debug level to 3 and peruse the
390 Most messages are reasonably self-explanatory. Unfortunately, at time of
391 creation of this man page the source code is still too fluid to warrant
392 describing each and every diagnostic. At this stage your best bet is still
393 to grep the source code and inspect the conditions that gave rise to the
394 diagnostics you are seeing.
399 The original Samba software and related utilities were created by
400 Andrew Tridgell (samba-bugs@anu.edu.au). Andrew is also the Keeper
401 of the Source for this project.
403 This man page written by Karl Auer (Karl.Auer@anu.edu.au)
406 .B smb.conf(5) for a full list of contributors and details on how to
407 submit bug reports, comments etc.