eded744ad22b509d2198a18ce43bebff350dc3c5
[gd/samba-autobuild/.git] / docs / yodldocs / smbd.8.yo
1 mailto(samba-bugs@samba.anu.edu.au) 
2
3 manpage(smbd htmlcommand((8)))(8)(23 Oct 1998)(Samba)(SAMBA)
4
5 label(NAME)
6 manpagename(smbd)(server to provide SMB/CIFS services to clients)
7
8 label(SYNOPSIS)
9 manpagesynopsis()
10
11 bf(smbd) [link(-D)(minusD)] [link(-a)(minusa)] [link(-o)(minuso)] [link(-d debuglevel)(minusd)] [link(-l log file)(minusl)] [link(-p port number)(minusp)] [link(-O socket options)(minusO)] [link(-s configuration file)(minuss)] [link(-i scope)(minusi)] [link(-P)(minusP)] [link(-h)(minush)]
12
13 label(DESCRIPTION)
14 manpagedescription()
15
16 This program is part of the bf(Samba) suite.
17
18 bf(smbd) is the server daemon that provides filesharing and printing
19 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.
25
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 
29 url(bf(smb.conf (5)))(smb.conf.5.html).  This man page
30 will not describe the services, but will concentrate on the
31 administrative aspects of running the server.
32
33 Please note that there are significant security implications to
34 running this server, and the 
35 url(bf(smb.conf (5)))(smb.conf.5.html) manpage should be
36 regarded as mandatory reading before proceeding with installation.
37
38 A session is created whenever a client requests one. Each client gets
39 a copy of the server for each session. This copy then services all
40 connections made by the client during that session. When all
41 connections from its client are closed, the copy of the server for
42 that client terminates.
43
44 The configuration file, and any files that it includes, are
45 automatically reloaded every minute, if they change.  You can force a
46 reload by sending a SIGHUP to the server.  Reloading the configuration
47 file will not affect connections to any service that is already
48 established.  Either the user will have to disconnect from the
49 service, or smbd killed and restarted.
50
51 label(OPTIONS)
52 manpageoptions()
53
54 startdit()
55
56 label(minusD)
57 dit(bf(-D)) If specified, this parameter causes the server to operate as a
58 daemon. That is, it detaches itself and runs in the background,
59 fielding requests on the appropriate port. Operating the server as a
60 daemon is the recommended way of running smbd for servers that provide
61 more than casual use file and print services.
62
63 By default, the server will NOT operate as a daemon. 
64
65 label(minusa)
66 dit(bf(-a)) If this parameter is specified, each new connection will
67 append log messages to the log file.  This is the default.
68
69 label(minuso)
70 dit(bf(-o)) If this parameter is specified, the log files will be
71 overwritten when opened.  By default, the log files will be appended
72 to.
73
74 label(minusd)
75 dit(bf(-d debuglevel)) debuglevel is an integer from 0 to 10.
76
77 The default value if this parameter is not specified is zero.
78
79 The higher this value, the more detail will be logged to the log files
80 about the activities of the server. At level 0, only critical errors
81 and serious warnings will be logged. Level 1 is a reasonable level for
82 day to day running - it generates a small amount of information about
83 operations carried out.
84
85 Levels above 1 will generate considerable amounts of log data, and
86 should only be used when investigating a problem. Levels above 3 are
87 designed for use only by developers and generate HUGE amounts of log
88 data, most of which is extremely cryptic.
89
90 Note that specifying this parameter here will override the url(bf(log
91 level))(smb.conf.5.html#loglevel) parameter in the url(bf(smb.conf
92 (5)))(smb.conf.5.html) file.
93
94 label(minusl) 
95 dit(bf(-l log file)) If specified, em(log file) specifies
96 a log filename into which informational and debug messages from the
97 running server will be logged. The log file generated is never removed
98 by the server although its size may be controlled by the url(bf(max
99 log size))(smb.conf.5.html#maxlogsize) option in the url(bf(smb.conf
100 (5)))(smb.conf.5.html) file.  The default log file name is specified
101 at compile time.
102
103 label(minusO)
104 dit(bf(-O socket options)) See the url(bf(socket
105 options))(smb.conf.5.html#socketoptions) parameter in the
106 url(bf(smb.conf (5)))(smb.conf.5.html) file for details.
107
108 label(minusp)
109 dit(bf(-p port number)) port number is a positive integer value.  The
110 default value if this parameter is not specified is 139.
111
112 This number is the port number that will be used when making
113 connections to the server from client software. The standard
114 (well-known) port number for the SMB over TCP is 139, hence the
115 default. If you wish to run the server as an ordinary user rather than
116 as root, most systems will require you to use a port number greater
117 than 1024 - ask your system administrator for help if you are in this
118 situation.
119
120 In order for the server to be useful by most clients, should you
121 configure it on a port other than 139, you will require port
122 redirection services on port 139, details of which are outlined in
123 rfc1002.txt section 4.3.5.
124
125 This parameter is not normally specified except in the above
126 situation.
127
128 label(minuss)
129 dit(bf(-s configuration file))
130 The file specified contains the configuration details required by the
131 server.  The information in this file includes server-specific
132 information such as what printcap file to use, as well as descriptions
133 of all the services that the server is to provide. See bf(smb.conf
134 (5)) for more information.
135 The default configuration file name is determined at compile time.
136
137 label(minusi)
138 dit(bf(-i scope)) This specifies a NetBIOS scope that the server will use
139 to communicate with when generating NetBIOS names. For details on the
140 use of NetBIOS scopes, see rfc1001.txt and rfc1002.txt. NetBIOS scopes
141 are em(very) rarely used, only set this parameter if you are the
142 system administrator in charge of all the NetBIOS systems you
143 communicate with.
144
145 label(minush)
146 dit(bf(-h)) Prints the help information (usage) for smbd.
147
148 label(minusP)
149 dit(bf(-P)) Passive option. Causes smbd not to send any network traffic
150 out. Used for debugging by the developers only.
151
152 endit()
153
154 label(FILES)
155 manpagefiles()
156
157 bf(/etc/inetd.conf)
158
159 If the server is to be run by the inetd meta-daemon, this file must
160 contain suitable startup information for the meta-daemon. See the
161 section link(INSTALLATION)(INSTALLATION) below.
162
163 bf(/etc/rc)
164
165 (or whatever initialization script your system uses).
166
167 If running the server as a daemon at startup, this file will need to
168 contain an appropriate startup sequence for the server. See the
169 section link(INSTALLATION)(INSTALLATION) below.
170
171 bf(/etc/services)
172
173 If running the server via the meta-daemon inetd, this file must
174 contain a mapping of service name (e.g., netbios-ssn) to service port
175 (e.g., 139) and protocol type (e.g., tcp). See the section
176 link(INSTALLATION)(INSTALLATION) below.
177
178 bf(/usr/local/samba/lib/smb.conf)
179
180 This is the default location of the em(smb.conf) server configuration
181 file. Other common places that systems install this file are
182 em(/usr/samba/lib/smb.conf) and em(/etc/smb.conf).
183
184 This file describes all the services the server is to make available
185 to clients. See url(bf(smb.conf (5)))(smb.conf.5.html) for more information.
186
187 label(LIMITATIONS)
188 manpagesection(LIMITATIONS)
189
190 On some systems bf(smbd) cannot change uid back to root after a
191 setuid() call.  Such systems are called "trapdoor" uid systems. If you
192 have such a system, you will be unable to connect from a client (such
193 as a PC) as two different users at once. Attempts to connect the
194 second user will result in "access denied" or similar.
195
196 label(ENVIRONMENTVARIABLES)
197 manpagesection(ENVIRONMENT VARIABLES)
198
199 bf(PRINTER)
200
201 If no printer name is specified to printable services, most systems
202 will use the value of this variable (or "lp" if this variable is not
203 defined) as the name of the printer to use. This is not specific to
204 the server, however.
205
206 label(INSTALLATION)
207 manpagesection(INSTALLATION)
208
209  The location of the server and its support files is a matter for
210 individual system administrators. The following are thus suggestions
211 only.
212
213 It is recommended that the server software be installed under the
214 /usr/local/samba hierarchy, in a directory readable by all, writeable
215 only by root. The server program itself should be executable by all,
216 as users may wish to run the server themselves (in which case it will
217 of course run with their privileges).  The server should NOT be
218 setuid. On some systems it may be worthwhile to make smbd setgid to an
219 empty group. This is because some systems may have a security hole
220 where daemon processes that become a user can be attached to with a
221 debugger. Making the smbd file setgid to an empty group may prevent
222 this hole from being exploited. This security hole and the suggested
223 fix has only been confirmed on old versions (pre-kernel 2.0) of Linux
224 at the time this was written. It is possible that this hole only
225 exists in Linux, as testing on other systems has thus far shown them
226 to be immune.
227
228 The server log files should be put in a directory readable and
229 writeable only by root, as the log files may contain sensitive
230 information.
231
232 The configuration file should be placed in a directory readable and
233 writeable only by root, as the configuration file controls security for
234 the services offered by the server. The configuration file can be made
235 readable by all if desired, but this is not necessary for correct
236 operation of the server and is not recommended. A sample configuration
237 file "smb.conf.sample" is supplied with the source to the server -
238 this may be renamed to "smb.conf" and modified to suit your needs.
239
240 The remaining notes will assume the following:
241
242 startit()
243
244 it() bf(smbd) (the server program) installed in /usr/local/samba/bin
245
246 it() bf(smb.conf) (the configuration file) installed in /usr/local/samba/lib
247
248 it() log files stored in /var/adm/smblogs
249
250 endit()
251
252 The server may be run either as a daemon by users or at startup, or it
253 may be run from a meta-daemon such as inetd upon request. If run as a
254 daemon, the server will always be ready, so starting sessions will be
255 faster. If run from a meta-daemon some memory will be saved and
256 utilities such as the tcpd TCP-wrapper may be used for extra security.
257 For serious use as file server it is recommended that bf(smbd) be run
258 as a daemon.
259
260 When you've decided, continue with either 
261 link(RUNNING THE SERVER AS A DAEMON)(RUNNINGTHESERVERASADAEMON) or 
262 link(RUNNING THE SERVER ON REQUEST)(RUNNINGTHESERVERONREQUEST).
263
264 label(RUNNINGTHESERVERASADAEMON)
265 manpagesection(RUNNING THE SERVER AS A DAEMON)
266
267 To run the server as a daemon from the command line, simply put the
268 link(bf(-D))(minusD) option on the command line. There is no need to place an
269 ampersand at the end of the command line - the link(bf(-D))(minusD) option causes
270 the server to detach itself from the tty anyway.
271
272 Any user can run the server as a daemon (execute permissions
273 permitting, of course). This is useful for testing purposes, and may
274 even be useful as a temporary substitute for something like ftp. When
275 run this way, however, the server will only have the privileges of the
276 user who ran it.
277
278 To ensure that the server is run as a daemon whenever the machine is
279 started, and to ensure that it runs as root so that it can serve
280 multiple clients, you will need to modify the system startup
281 files. Wherever appropriate (for example, in /etc/rc), insert the
282 following line, substituting port number, log file location,
283 configuration file location and debug level as desired:
284
285 tt(/usr/local/samba/bin/smbd -D -l /var/adm/smblogs/log -s /usr/local/samba/lib/smb.conf)
286
287 (The above should appear in your initialization script as a single line. 
288 Depending on your terminal characteristics, it may not appear that way in
289 this man page. If the above appears as more than one line, please treat any 
290 newlines or indentation as a single space or TAB character.)
291
292 If the options used at compile time are appropriate for your system,
293 all parameters except link(bf(-D))(minusD) may be
294 omitted. See the section link(OPTIONS)(OPTIONS) above.
295
296 label(RUNNINGTHESERVERONREQUEST)
297 manpagesection(RUNNING THE SERVER ON REQUEST)
298
299  If your system uses a meta-daemon such as bf(inetd), you can arrange to
300 have the smbd server started whenever a process attempts to connect to
301 it. This requires several changes to the startup files on the host
302 machine. If you are experimenting as an ordinary user rather than as
303 root, you will need the assistance of your system administrator to
304 modify the system files.
305
306 You will probably want to set up the NetBIOS name server url(bf(nmbd))(nmbd.8.html) at
307 the same time as bf(smbd). To do this refer to the man page for
308 url(bf(nmbd (8)))(nmbd.8.html).
309
310 First, ensure that a port is configured in the file tt(/etc/services). The
311 well-known port 139 should be used if possible, though any port may be
312 used.
313
314 Ensure that a line similar to the following is in tt(/etc/services):
315
316 tt(netbios-ssn  139/tcp)
317
318 Note for NIS/YP users - you may need to rebuild the NIS service maps
319 rather than alter your local tt(/etc/services file).
320
321 Next, put a suitable line in the file tt(/etc/inetd.conf) (in the unlikely
322 event that you are using a meta-daemon other than inetd, you are on
323 your own). Note that the first item in this line matches the service
324 name in tt(/etc/services).  Substitute appropriate values for your system
325 in this line (see bf(inetd (8))):
326
327 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)
328
329 (The above should appear in tt(/etc/inetd.conf) as a single
330 line. Depending on your terminal characteristics, it may not appear
331 that way in this man page.  If the above appears as more than one
332 line, please treat any newlines or indentation as a single space or
333 TAB character.)
334
335 Note that there is no need to specify a port number here, even if you
336 are using a non-standard port number.
337
338 Lastly, edit the configuration file to provide suitable services. To
339 start with, the following two services should be all you need:
340
341 verb(
342
343 [homes]
344   writeable = yes
345
346 [printers]
347  writeable = no
348  printable = yes
349  path = /tmp
350  public = yes
351
352 )
353
354 This will allow you to connect to your home directory and print to any
355 printer supported by the host (user privileges permitting).
356
357 label(TESTINGTHEINSTALLATION)
358 manpagesection(TESTING THE INSTALLATION)
359
360 If running the server as a daemon, execute it before proceeding. If
361 using a meta-daemon, either restart the system or kill and restart the
362 meta-daemon. Some versions of inetd will reread their configuration
363 tables if they receive a HUP signal.
364
365 If your machine's name is "fred" and your name is "mary", you should
366 now be able to connect to the service tt(\\fred\mary).
367
368 To properly test and experiment with the server, we recommend using
369 the smbclient program (see 
370 url(bf(smbclient (1)))(smbclient.1.html)) and also going through
371 the steps outlined in the file em(DIAGNOSIS.txt) in the em(docs/)
372 directory of your Samba installation.
373
374 label(VERSION)
375 manpagesection(VERSION)
376
377 This man page is correct for version 2.0 of the Samba suite.
378
379 label(DIAGNOSTICS)
380 manpagesection(DIAGNOSTICS)
381
382 Most diagnostics issued by the server are logged in a specified log
383 file. The log file name is specified at compile time, but may be
384 overridden on the command line.
385
386 The number and nature of diagnostics available depends on the debug
387 level used by the server. If you have problems, set the debug level to
388 3 and peruse the log files.
389
390 Most messages are reasonably self-explanatory. Unfortunately, at the time
391 this man page was created, there are too many diagnostics available
392 in the source code to warrant describing each and every diagnostic. At
393 this stage your best bet is still to grep the source code and inspect
394 the conditions that gave rise to the diagnostics you are seeing.
395
396 label(SIGNALS)
397 manpagesection(SIGNALS)
398
399 Sending the smbd a SIGHUP will cause it to re-load its smb.conf
400 configuration file within a short period of time.
401
402 To shut down a users smbd process it is recommended that SIGKILL (-9)
403 em(NOT) be used, except as a last resort, as this may leave the shared
404 memory area in an inconsistent state. The safe way to terminate an
405 smbd is to send it a SIGTERM (-15) signal and wait for it to die on
406 its own.
407
408 The debug log level of smbd may be raised
409 by sending it a SIGUSR1 tt((kill -USR1 <smbd-pid>)) and lowered by
410 sending it a SIGUSR2 tt((kill -USR2 <smbd-pid>)). This is to allow
411 transient problems to be diagnosed, whilst still running at a normally
412 low log level.
413
414 Note that as the signal handlers send a debug write, they are not
415 re-entrant in smbd. This you should wait until smbd is in a state of
416 waiting for an incoming smb before issuing them. It is possible to
417 make the signal handlers safe by un-blocking the signals before the
418 select call and re-blocking them after, however this would affect
419 performance.
420
421 label(SEEALSO)
422 manpageseealso()
423
424 bf(hosts_access (5)), bf(inetd (8)), url(bf(nmbd (8)))(nmbd.8.html),
425 url(bf(smb.conf (5)))(smb.conf.5.html), url(bf(smbclient
426 (1)))(smbclient.1.html), url(bf(testparm (1)))(testparm.1.html),
427 url(bf(testprns (1)))(testprns.1.html), and the Internet RFC's
428 bf(rfc1001.txt), bf(rfc1002.txt). In addition the CIFS (formerly SMB)
429 specification is available as a link from the Web page :
430 url(http://samba.anu.edu.au/cifs/)(http://samba.anu.edu.au/cifs/).
431
432 label(AUTHOR)
433 manpageauthor()
434
435 The original Samba software and related utilities were created by
436 Andrew Tridgell email(samba-bugs@samba.anu.edu.au). Samba is now developed
437 by the Samba Team as an Open Source project similar to the way the
438 Linux kernel is developed.
439
440 The original Samba man pages were written by Karl Auer. The man page
441 sources were converted to YODL format (another excellent piece of Open
442 Source software, available at
443 url(bf(ftp://ftp.icce.rug.nl/pub/unix/))(ftp://ftp.icce.rug.nl/pub/unix/))
444 and updated for the Samba2.0 release by Jeremy Allison.
445 email(samba-bugs@samba.anu.edu.au).
446
447 See url(bf(samba (7)))(samba.7.html) to find out how to get a full list of contributors
448 and details on how to submit bug reports, comments etc.