Basic doc changes to keep up to date.
[kai/samba.git] / docs / manpages / smbd.8
1 .TH SMBD 8 17/1/1995 smbd smbd
2 .SH NAME
3 smbd \- provide SMB (aka LanManager) services to clients
4 .SH SYNOPSIS
5 .B smbd
6 [
7 .B -D
8 ] [
9 .B -a
10 ] [
11 .B -d
12 .I debuglevel
13 ] [
14 .B -l
15 .I log file
16 ] [
17 .B -p
18 .I port number
19 ] [
20 .B -O
21 .I socket options
22 ] [
23 .B -s
24 .I configuration file
25 ]
26 .SH DESCRIPTION
27 This program is part of the Samba suite.
28
29 .B smbd
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.
34
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
37 services (see
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.
40
41 Please note that there are significant security implications to running this
42 server, and
43 .B smb.conf(5) should be regarded as mandatory reading before proceeding with 
44 installation.
45
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.
50
51 The configuration file is automatically reloaded if it changes. You
52 can force a reload by sending a SIGHUP to the server.
53
54 .SH OPTIONS
55 .B -D
56
57 .RS 3
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 
60 appropriate port.
61
62 By default, the server will NOT operate as a daemon.
63 .RE
64
65 .B -a
66
67 .RS 3
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.
70 .RE
71
72 .B -d
73 .I debuglevel
74 .RS 3
75
76 debuglevel is an integer from 0 to 5.
77
78 The default value if this parameter is not specified is zero.
79
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.
84
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 
88 is extremely cryptic.
89 .RE
90
91 .B -l
92 .I log file
93
94 .RS 3
95 If specified,
96 .I logfile
97 specifies a base filename into which operational data from the running server
98 will be logged.
99
100 The default base name is specified at compile time.
101
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:
104
105 .RS 3
106 log.debug (containing debugging information)
107
108 log.in (containing inbound transaction data)
109
110 log.out (containing outbound transaction data)
111 .RE
112
113 The log files generated are never removed by the server.
114 .RE
115
116 .B -O
117 .I socket options
118 .RS 3
119
120 See the socket options section of smb.conf(5) for details
121
122 .RE
123 .B -p
124 .I port number
125 .RS 3
126
127 port number is a positive integer value.
128
129 The default value if this parameter is not specified is 139.
130
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
136 situation.
137
138 This parameter is not normally specified except in the above situation.
139 .RE
140
141 .B -s
142 .I configuration file
143
144 .RS 3
145 The default configuration file name is determined at compile time.
146
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.
152 .RE
153
154 .SH FILES
155
156 .B /etc/inetd.conf
157
158 .RS 3
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.
162 .RE
163
164 .B /etc/rc
165
166 .RS 3
167 (or whatever initialisation script your system uses)
168
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"
171 below.
172 .RE
173
174 .B /etc/services
175
176 .RS 3
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.
180 .RE
181
182 .B /usr/local/smb/smb.conf
183
184 .RS 3
185 This file describes all the services the server is to make available to
186 clients. See
187 .B smb.conf(5) for more information.
188 .RE
189 .RE
190
191 .SH LIMITATIONS
192
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
197 denied" or similar.
198
199 .SH ENVIRONMENT VARIABLES
200
201 .B PRINTER
202
203 .RS 3
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,
207 however.
208 .RE
209
210 .SH INSTALLATION
211 The location of the server and its support files is a matter for individual
212 system administrators. The following are thus suggestions only.
213
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.
227
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.
230
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.
238
239 The remaining notes will assume the following:
240
241 .RS 3
242 smbd (the server program) installed in /usr/local/smb
243
244 smb.conf (the configuration file) installed in /usr/local/smb
245
246 log files stored in /var/adm/smblogs
247 .RE
248
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.
254
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
261 tty anyway.
262
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.
267
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
273 desired:
274
275 .RS 3
276 /usr/local/smb/smbd -D -l /var/adm/smblogs/log -s /usr/local/smb/smb.conf
277 .RE
278
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.)
283
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.
293
294 You will probably want to set up the name server
295 .B nmbd
296 at the same time as
297 the smbd - refer to the man page 
298 .B nmbd(8).
299
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.
302
303 Ensure that a line similar to the following is in /etc/services:
304
305 .RS 3
306 netbios-ssn     139/tcp
307 .RE
308
309 Note for NIS/YP users - you may need to rebuild the NIS service maps rather
310 than alter your local /etc/services file.
311
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
316 .B inetd(8)):
317
318 .RS 3
319 netbios-ssn stream tcp nowait root /usr/local/smb/smbd -d1 
320 -l/var/adm/smblogs/log -s/usr/local/smb/smb.conf
321 .RE
322
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.)
327
328 Note that there is no need to specify a port number here, even if you are 
329 using a non-standard port number.
330
331 Lastly, edit the configuration file to provide suitable services. To start
332 with, the following two services should be all you need:
333
334 .RS 3
335 [homes]
336 .RS 3
337  writable = yes
338 .RE
339
340 [printers]
341 .RS 3
342  writable = no
343  printable = yes
344  path = /tmp
345  public = yes
346 .RE
347 .RE
348
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.
356
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".
359
360 To properly test and experiment with the server, we recommend using the
361 smbclient program (see
362 .B smbclient(1)).
363 .SH VERSION
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 
369 rectification.
370 .SH SEE ALSO
371 .B hosts_access(5),
372 .B inetd(8),
373 .B nmbd(8), 
374 .B smb.conf(5),
375 .B smbclient(1),
376 .B testparm(1), 
377 .B testprns(1)
378
379 .SH DIAGNOSTICS
380 [This section under construction]
381
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
384 command line.
385
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
388 log files.
389
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.
395
396 .SH BUGS
397 None known.
398 .SH CREDITS
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.
402
403 This man page written by Karl Auer (Karl.Auer@anu.edu.au)
404
405 See
406 .B smb.conf(5) for a full list of contributors and details on how to 
407 submit bug reports, comments etc.