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