first pass at updating head branch to be to be the same as the SAMBA_2_0 branch
[samba.git] / docs / manpages / smbd.8
1 .TH "smbd " "8" "23 Oct 1998" "Samba" "SAMBA" 
2 .PP 
3 .SH "NAME" 
4 smbd \- server to provide SMB/CIFS services to clients
5 .PP 
6 .SH "SYNOPSIS" 
7 .PP 
8 \fBsmbd\fP [-D] [-a] [-o] [-P] [-h] [-V] [-d debuglevel] [-l log file] [-p port number] [-O socket options] [-s configuration file] [-i scope]
9 .PP 
10 .SH "DESCRIPTION" 
11 .PP 
12 This program is part of the \fBSamba\fP suite\&.
13 .PP 
14 \fBsmbd\fP is the server daemon that provides filesharing and printing
15 services to
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\&.
21 .PP 
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\&.
28 .PP 
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\&.
33 .PP 
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\&.
39 .PP 
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\&.
46 .PP 
47 .SH "OPTIONS" 
48 .PP 
49 .IP 
50 .IP "\fB-D\fP" 
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\&.
56 .IP 
57 By default, the server will NOT operate as a daemon\&. 
58 .IP 
59 .IP "\fB-a\fP" 
60 If this parameter is specified, each new connection will
61 append log messages to the log file\&.  This is the default\&.
62 .IP 
63 .IP "\fB-o\fP" 
64 If this parameter is specified, the log files will be
65 overwritten when opened\&.  By default, the log files will be appended
66 to\&.
67 .IP 
68 .IP "\fB-P\fP" 
69 Passive option\&. Causes smbd not to send any network traffic
70 out\&. Used for debugging by the developers only\&.
71 .IP 
72 .IP "\fB-h\fP" 
73 Prints the help information (usage) for \fBsmbd\fP\&.
74 .IP 
75 .IP "\fB-V\fP" 
76 Prints the version number for \fBsmbd\fP\&.
77 .IP 
78 .IP "\fB-d debuglevel\fP" 
79 debuglevel is an integer from 0 to 10\&.
80 .IP 
81 The default value if this parameter is not specified is zero\&.
82 .IP 
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\&.
88 .IP 
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\&.
93 .IP 
94 Note that specifying this parameter here will override the \fBlog
95 level\fP parameter in the \fBsmb\&.conf
96 (5)\fP file\&.
97 .IP 
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
105 at compile time\&.
106 .IP 
107 .IP "\fB-O socket options\fP" 
108 See the \fBsocket
109 options\fP parameter in the
110 \fBsmb\&.conf (5)\fP file for details\&.
111 .IP 
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\&.
115 .IP 
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
122 situation\&.
123 .IP 
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\&.
128 .IP 
129 This parameter is not normally specified except in the above
130 situation\&.
131 .IP 
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\&.
139 .IP 
140 .IP "\fB-i scope\fP" 
141 This specifies a NetBIOS scope that the server will use
142 to communicate with when generating NetBIOS names\&. For details on the
143 use of NetBIOS scopes, see rfc1001\&.txt and rfc1002\&.txt\&. NetBIOS scopes
144 are \fIvery\fP rarely used, only set this parameter if you are the
145 system administrator in charge of all the NetBIOS systems you
146 communicate with\&.
147 .IP 
148 .PP 
149 .SH "FILES" 
150 .PP 
151 \fB/etc/inetd\&.conf\fP
152 .PP 
153 If the server is to be run by the inetd meta-daemon, this file must
154 contain suitable startup information for the meta-daemon\&. See the
155 section INSTALLATION below\&.
156 .PP 
157 \fB/etc/rc\fP
158 .PP 
159 (or whatever initialization script your system uses)\&.
160 .PP 
161 If running the server as a daemon at startup, this file will need to
162 contain an appropriate startup sequence for the server\&. See the
163 section INSTALLATION below\&.
164 .PP 
165 \fB/etc/services\fP
166 .PP 
167 If running the server via the meta-daemon inetd, this file must
168 contain a mapping of service name (e\&.g\&., netbios-ssn) to service port
169 (e\&.g\&., 139) and protocol type (e\&.g\&., tcp)\&. See the section
170 INSTALLATION below\&.
171 .PP 
172 \fB/usr/local/samba/lib/smb\&.conf\fP
173 .PP 
174 This is the default location of the \fIsmb\&.conf\fP server configuration
175 file\&. Other common places that systems install this file are
176 \fI/usr/samba/lib/smb\&.conf\fP and \fI/etc/smb\&.conf\fP\&.
177 .PP 
178 This file describes all the services the server is to make available
179 to clients\&. See \fBsmb\&.conf (5)\fP for more information\&.
180 .PP 
181 .SH "LIMITATIONS" 
182 .PP 
183 On some systems \fBsmbd\fP cannot change uid back to root after a
184 setuid() call\&.  Such systems are called "trapdoor" uid systems\&. If you
185 have such a system, you will be unable to connect from a client (such
186 as a PC) as two different users at once\&. Attempts to connect the
187 second user will result in "access denied" or similar\&.
188 .PP 
189 .SH "ENVIRONMENT VARIABLES" 
190 .PP 
191 \fBPRINTER\fP
192 .PP 
193 If no printer name is specified to printable services, most systems
194 will use the value of this variable (or "lp" if this variable is not
195 defined) as the name of the printer to use\&. This is not specific to
196 the server, however\&.
197 .PP 
198 .SH "INSTALLATION" 
199 .PP 
200 The location of the server and its support files is a matter for
201 individual system administrators\&. The following are thus suggestions
202 only\&.
203 .PP 
204 It is recommended that the server software be installed under the
205 /usr/local/samba hierarchy, in a directory readable by all, writeable
206 only by root\&. The server program itself should be executable by all,
207 as users may wish to run the server themselves (in which case it will
208 of course run with their privileges)\&.  The server should NOT be
209 setuid\&. On some systems it may be worthwhile to make smbd setgid to an
210 empty group\&. This is because some systems may have a security hole
211 where daemon processes that become a user can be attached to with a
212 debugger\&. Making the smbd file setgid to an empty group may prevent
213 this hole from being exploited\&. This security hole and the suggested
214 fix has only been confirmed on old versions (pre-kernel 2\&.0) of Linux
215 at the time this was written\&. It is possible that this hole only
216 exists in Linux, as testing on other systems has thus far shown them
217 to be immune\&.
218 .PP 
219 The server log files should be put in a directory readable and
220 writeable only by root, as the log files may contain sensitive
221 information\&.
222 .PP 
223 The configuration file should be placed in a directory readable and
224 writeable only by root, as the configuration file controls security for
225 the services offered by the server\&. The configuration file can be made
226 readable by all if desired, but this is not necessary for correct
227 operation of the server and is not recommended\&. A sample configuration
228 file "smb\&.conf\&.sample" is supplied with the source to the server -
229 this may be renamed to "smb\&.conf" and modified to suit your needs\&.
230 .PP 
231 The remaining notes will assume the following:
232 .PP 
233 .IP 
234 .IP o 
235 \fBsmbd\fP (the server program) installed in /usr/local/samba/bin
236 .IP 
237 .IP o 
238 \fBsmb\&.conf\fP (the configuration file) installed in /usr/local/samba/lib
239 .IP 
240 .IP o 
241 log files stored in /var/adm/smblogs
242 .IP 
243 .PP 
244 The server may be run either as a daemon by users or at startup, or it
245 may be run from a meta-daemon such as inetd upon request\&. If run as a
246 daemon, the server will always be ready, so starting sessions will be
247 faster\&. If run from a meta-daemon some memory will be saved and
248 utilities such as the tcpd TCP-wrapper may be used for extra security\&.
249 For serious use as file server it is recommended that \fBsmbd\fP be run
250 as a daemon\&.
251 .PP 
252 When you\'ve decided, continue with either 
253 RUNNING THE SERVER AS A DAEMON or 
254 RUNNING THE SERVER ON REQUEST\&.
255 .PP 
256 .SH "RUNNING THE SERVER AS A DAEMON" 
257 .PP 
258 To run the server as a daemon from the command line, simply put the
259 \fB-D\fP option on the command line\&. There is no need to place an
260 ampersand at the end of the command line - the \fB-D\fP option causes
261 the server to detach itself from the tty anyway\&.
262 .PP 
263 Any user can run the server as a daemon (execute permissions
264 permitting, of course)\&. This is useful for testing purposes, and may
265 even be useful as a temporary substitute for something like ftp\&. When
266 run this way, however, the server will only have the privileges of the
267 user who ran it\&.
268 .PP 
269 To ensure that the server is run as a daemon whenever the machine is
270 started, and to ensure that it runs as root so that it can serve
271 multiple clients, you will need to modify the system startup
272 files\&. Wherever appropriate (for example, in /etc/rc), insert the
273 following line, substituting port number, log file location,
274 configuration file location and debug level as desired:
275 .PP 
276 \f(CW/usr/local/samba/bin/smbd -D -l /var/adm/smblogs/log -s /usr/local/samba/lib/smb\&.conf\fP
277 .PP 
278 (The above should appear in your initialization script as a single line\&. 
279 Depending on your terminal characteristics, it may not appear that way in
280 this man page\&. If the above appears as more than one line, please treat any 
281 newlines or indentation as a single space or TAB character\&.)
282 .PP 
283 If the options used at compile time are appropriate for your system,
284 all parameters except \fB-D\fP may be
285 omitted\&. See the section OPTIONS above\&.
286 .PP 
287 .SH "RUNNING THE SERVER ON REQUEST" 
288 .PP 
289 If your system uses a meta-daemon such as \fBinetd\fP, you can arrange to
290 have the smbd server started whenever a process attempts to connect to
291 it\&. This requires several changes to the startup files on the host
292 machine\&. If you are experimenting as an ordinary user rather than as
293 root, you will need the assistance of your system administrator to
294 modify the system files\&.
295 .PP 
296 You will probably want to set up the NetBIOS name server \fBnmbd\fP at
297 the same time as \fBsmbd\fP\&. To do this refer to the man page for
298 \fBnmbd (8)\fP\&.
299 .PP 
300 First, ensure that a port is configured in the file \f(CW/etc/services\fP\&. The
301 well-known port 139 should be used if possible, though any port may be
302 used\&.
303 .PP 
304 Ensure that a line similar to the following is in \f(CW/etc/services\fP:
305 .PP 
306 \f(CWnetbios-ssn        139/tcp\fP
307 .PP 
308 Note for NIS/YP users - you may need to rebuild the NIS service maps
309 rather than alter your local \f(CW/etc/services file\fP\&.
310 .PP 
311 Next, put a suitable line in the file \f(CW/etc/inetd\&.conf\fP (in the unlikely
312 event that you are using a meta-daemon other than inetd, you are on
313 your own)\&. Note that the first item in this line matches the service
314 name in \f(CW/etc/services\fP\&.  Substitute appropriate values for your system
315 in this line (see \fBinetd (8)\fP):
316 .PP 
317 \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
318 .PP 
319 (The above should appear in \f(CW/etc/inetd\&.conf\fP as a single
320 line\&. Depending on your terminal characteristics, it may not appear
321 that way in this man page\&.  If the above appears as more than one
322 line, please treat any newlines or indentation as a single space or
323 TAB character\&.)
324 .PP 
325 Note that there is no need to specify a port number here, even if you
326 are using a non-standard port number\&.
327 .PP 
328 Lastly, edit the configuration file to provide suitable services\&. To
329 start with, the following two services should be all you need:
330 .PP 
331
332 .DS 
333  
334
335
336 [homes]
337   writeable = yes
338
339 [printers]
340  writeable = no
341  printable = yes
342  path = /tmp
343  public = yes
344
345
346 .DE 
347  
348
349 .PP 
350 This will allow you to connect to your home directory and print to any
351 printer supported by the host (user privileges permitting)\&.
352 .PP 
353 .SH "TESTING THE INSTALLATION" 
354 .PP 
355 If running the server as a daemon, execute it before proceeding\&. If
356 using a meta-daemon, either restart the system or kill and restart the
357 meta-daemon\&. Some versions of inetd will reread their configuration
358 tables if they receive a HUP signal\&.
359 .PP 
360 If your machine\'s name is "fred" and your name is "mary", you should
361 now be able to connect to the service \f(CW\e\efred\emary\fP\&.
362 .PP 
363 To properly test and experiment with the server, we recommend using
364 the smbclient program (see 
365 \fBsmbclient (1)\fP) and also going through
366 the steps outlined in the file \fIDIAGNOSIS\&.txt\fP in the \fIdocs/\fP
367 directory of your Samba installation\&.
368 .PP 
369 .SH "VERSION" 
370 .PP 
371 This man page is correct for version 2\&.0 of the Samba suite\&.
372 .PP 
373 .SH "DIAGNOSTICS" 
374 .PP 
375 Most diagnostics issued by the server are logged in a specified log
376 file\&. The log file name is specified at compile time, but may be
377 overridden on the command line\&.
378 .PP 
379 The number and nature of diagnostics available depends on the debug
380 level used by the server\&. If you have problems, set the debug level to
381 3 and peruse the log files\&.
382 .PP 
383 Most messages are reasonably self-explanatory\&. Unfortunately, at the time
384 this man page was created, there are too many diagnostics available
385 in the source code to warrant describing each and every diagnostic\&. At
386 this stage your best bet is still to grep the source code and inspect
387 the conditions that gave rise to the diagnostics you are seeing\&.
388 .PP 
389 .SH "SIGNALS" 
390 .PP 
391 Sending the smbd a SIGHUP will cause it to re-load its smb\&.conf
392 configuration file within a short period of time\&.
393 .PP 
394 To shut down a users smbd process it is recommended that SIGKILL (-9)
395 \fINOT\fP be used, except as a last resort, as this may leave the shared
396 memory area in an inconsistent state\&. The safe way to terminate an
397 smbd is to send it a SIGTERM (-15) signal and wait for it to die on
398 its own\&.
399 .PP 
400 The debug log level of smbd may be raised
401 by sending it a SIGUSR1 \f(CW(kill -USR1 <smbd-pid>)\fP and lowered by
402 sending it a SIGUSR2 \f(CW(kill -USR2 <smbd-pid>)\fP\&. This is to allow
403 transient problems to be diagnosed, whilst still running at a normally
404 low log level\&.
405 .PP 
406 Note that as the signal handlers send a debug write, they are not
407 re-entrant in smbd\&. This you should wait until smbd is in a state of
408 waiting for an incoming smb before issuing them\&. It is possible to
409 make the signal handlers safe by un-blocking the signals before the
410 select call and re-blocking them after, however this would affect
411 performance\&.
412 .PP 
413 .SH "SEE ALSO" 
414 .PP 
415 \fBhosts_access (5)\fP, \fBinetd (8)\fP, \fBnmbd (8)\fP,
416 \fBsmb\&.conf (5)\fP, \fBsmbclient
417 (1)\fP, \fBtestparm (1)\fP,
418 \fBtestprns (1)\fP, and the Internet RFC\'s
419 \fBrfc1001\&.txt\fP, \fBrfc1002\&.txt\fP\&. In addition the CIFS (formerly SMB)
420 specification is available as a link from the Web page :
421 http://samba\&.org/cifs/\&.
422 .PP 
423 .SH "AUTHOR" 
424 .PP 
425 The original Samba software and related utilities were created by
426 Andrew Tridgell \fIsamba-bugs@samba\&.org\fP\&. Samba is now developed
427 by the Samba Team as an Open Source project similar to the way the
428 Linux kernel is developed\&.
429 .PP 
430 The original Samba man pages were written by Karl Auer\&. The man page
431 sources were converted to YODL format (another excellent piece of Open
432 Source software, available at
433 \fBftp://ftp\&.icce\&.rug\&.nl/pub/unix/\fP)
434 and updated for the Samba2\&.0 release by Jeremy Allison\&.
435 \fIsamba-bugs@samba\&.org\fP\&.
436 .PP 
437 See \fBsamba (7)\fP to find out how to get a full list of contributors
438 and details on how to submit bug reports, comments etc\&.