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