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