7 CONTENT=
"Modular DocBook HTML Stylesheet Version 1.57"></HEAD
27 >smbd
--
server to provide SMB/CIFS services to clients
</DIV
29 CLASS=
"REFSYNOPSISDIV"
39 > [-D] [-a] [-o] [-P] [-h] [-V] [-d
<debug level
>] [-l
<log file
>] [-p
<port number
>] [-O
<socket option
>] [-s
<configuration file
>]
</P
49 >This program is part of the Samba suite.
</P
54 > is the server daemon that
55 provides filesharing and printing services to Windows clients.
56 The server provides filespace and printer services to
57 clients using the SMB (or CIFS) protocol. This is compatible
58 with the LanManager protocol, and can service LanManager
59 clients. These include MSCLIENT
3.0 for DOS, Windows for
60 Workgroups, Windows
95/
98/ME, Windows NT, Windows
2000,
61 OS/
2, DAVE for Macintosh, and smbfs for Linux.
</P
63 >An extensive description of the services that the
64 server can provide is given in the man page for the
65 configuration file controlling the attributes of those
67 HREF=
"smb.conf.5.html"
74 >. This man page will not describe the
75 services, but will concentrate on the administrative aspects
76 of running the server.
</P
78 >Please note that there are significant security
79 implications to running this server, and the
<A
80 HREF=
"smb.conf.5.html"
87 manpage should be regarded as mandatory reading before
88 proceeding with installation.
</P
90 >A session is created whenever a client requests one.
91 Each client gets a copy of the server for each session. This
92 copy then services all connections made by the client during
93 that session. When all connections from its client are closed,
94 the copy of the server for that client terminates.
</P
96 >The configuration file, and any files that it includes,
97 are automatically reloaded every minute, if they change. You
98 can force a reload by sending a SIGHUP to the server. Reloading
99 the configuration file will not affect connections to any service
100 that is already established. Either the user will have to
101 disconnect from the service, or smbd killed and restarted.
</P
119 >If specified, this parameter causes
120 the server to operate as a daemon. That is, it detaches
121 itself and runs in the background, fielding requests
122 on the appropriate port. Operating the server as a
123 daemon is the recommended way of running smbd for
124 servers that provide more than casual use file and
125 print services. This switch is assumed is
<B
129 > is executed on the command line of a shell.
136 >If this parameter is specified, each new
137 connection will append log messages to the log file.
138 This is the default.
</P
144 >If this parameter is specified, the
145 log files will be overwritten when opened. By default,
149 > will append entries to the log
156 >Passive option. Causes smbd not to
157 send any network traffic out. Used for debugging by
158 the developers only.
</P
164 >Prints the help information (usage)
174 >Prints the version number for
181 >-d
<debug level
></DT
184 >debuglevel is an integer
185 from
0 to
10. The default value if this parameter is
186 not specified is zero.
</P
188 >The higher this value, the more detail will be
189 logged to the log files about the activities of the
190 server. At level
0, only critical errors and serious
191 warnings will be logged. Level
1 is a reasonable level for
192 day to day running - it generates a small amount of
193 information about operations carried out.
</P
195 >Levels above
1 will generate considerable
196 amounts of log data, and should only be used when
197 investigating a problem. Levels above
3 are designed for
198 use only by developers and generate HUGE amounts of log
199 data, most of which is extremely cryptic.
</P
201 >Note that specifying this parameter here will
203 HREF=
"smb.conf.5.html#loglevel"
207 > parameter in the
<A
208 HREF=
"smb.conf.5.html"
217 >-l
<log file
></DT
223 specifies a log filename into which informational and debug
224 messages from the running server will be logged. The log
225 file generated is never removed by the server although
226 its size may be controlled by the
<A
227 HREF=
"smb.conf.5.html#maxlogsize"
232 HREF=
"smb.conf.5.html"
238 > file. The default log
239 file name is specified at compile time.
</P
242 >-O
<socket options
></DT
246 HREF=
"smb.conf.5.html#socketoptions"
251 HREF=
"smb.conf.5.html"
258 > file for details.
</P
261 >-p
<port number
></DT
264 >port number is a positive integer
265 value. The default value if this parameter is not
268 >This number is the port number that will be
269 used when making connections to the server from client
270 software. The standard (well-known) port number for the
271 SMB over TCP is
139, hence the default. If you wish to
272 run the server as an ordinary user rather than
273 as root, most systems will require you to use a port
274 number greater than
1024 - ask your system administrator
275 for help if you are in this situation.
</P
277 >In order for the server to be useful by most
278 clients, should you configure it on a port other
279 than
139, you will require port redirection services
280 on port
139, details of which are outlined in rfc1002.txt
283 >This parameter is not normally specified except
284 in the above situation.
</P
287 >-s
<configuration file
></DT
290 >The file specified contains the
291 configuration details required by the server. The
292 information in this file includes server-specific
293 information such as what printcap file to use, as well
294 as descriptions of all the services that the server is
296 HREF=
"smb.conf.5.html"
302 > for more information.
303 The default configuration file name is determined at
328 >If the server is to be run by the
332 > meta-daemon, this file
333 must contain suitable startup information for the
334 meta-daemon. See the section INSTALLATION below.
344 >or whatever initialization script your
347 >If running the server as a daemon at startup,
348 this file will need to contain an appropriate startup
349 sequence for the server. See the section INSTALLATION
359 >If running the server via the
364 must contain a mapping of service name (e.g., netbios-ssn)
365 to service port (e.g.,
139) and protocol type (e.g., tcp).
366 See the section INSTALLATION below.
</P
371 >/usr/local/samba/lib/smb.conf
</TT
375 >This is the default location of the
377 HREF=
"smb.conf.5.html"
384 server configuration file. Other common places that systems
385 install this file are
<TT
387 >/usr/samba/lib/smb.conf
</TT
394 >This file describes all the services the server
395 is to make available to clients. See
<A
396 HREF=
"smb.conf.5.html"
402 > for more information.
</P
418 > cannot change uid back
419 to root after a setuid() call. Such systems are called
420 trapdoor uid systems. If you have such a system,
421 you will be unable to connect from a client (such as a PC) as
422 two different users at once. Attempts to connect the
423 second user will result in access denied or
432 >ENVIRONMENTVARIABLES
</H2
442 >If no printer name is specified to
443 printable services, most systems will use the value of
444 this variable (or lp if this variable is
445 not defined) as the name of the printer to use. This
446 is not specific to the server, however.
</P
459 >The location of the server and its support files
460 is a matter for individual system administrators. The following
461 are thus suggestions only.
</P
463 >It is recommended that the server software be installed
466 >/usr/local/samba/
</TT
468 in a directory readable by all, writeable only by root. The server
469 program itself should be executable by all, as users may wish to
470 run the server themselves (in which case it will of course run
471 with their privileges). The server should NOT be setuid. On some
472 systems it may be worthwhile to make smbd setgid to an empty group.
473 This is because some systems may have a security hole where daemon
474 processes that become a user can be attached to with a debugger.
475 Making the smbd file setgid to an empty group may prevent
476 this hole from being exploited. This security hole and the suggested
477 fix has only been confirmed on old versions (pre-kernel
2.0) of Linux
478 at the time this was written. It is possible that this hole only
479 exists in Linux, as testing on other systems has thus far shown them
482 >The server log files should be put in a directory readable and
483 writeable only by root, as the log files may contain sensitive
486 >The configuration file should be placed in a directory
487 readable and writeable only by root, as the configuration file
488 controls security for the services offered by the server. The
489 configuration file can be made readable by all if desired, but
490 this is not necessary for correct operation of the server and is
491 not recommended. A sample configuration file
<TT
495 > is supplied with the source to the server - this may
499 > and modified to suit
502 >The remaining notes will assume the following:
</P
511 > (the server program)
514 >/usr/local/samba/bin
</TT
523 file) installed in
<TT
525 >/usr/local/samba/lib
</TT
530 >log files stored in
<TT
538 >The server may be run either as a daemon by users
539 or at startup, or it may be run from a meta-daemon such as
543 > upon request. If run as a daemon,
544 the server will always be ready, so starting sessions will be
545 faster. If run from a meta-daemon some memory will be saved and
546 utilities such as the tcpd TCP-wrapper may be used for extra
547 security. For serious use as file server it is recommended
551 > be run as a daemon.
</P
553 >When you've decided, continue with either
</P
559 >RUNNING THE SERVER AS A DAEMON or
</P
563 >RUNNING THE SERVER ON REQUEST.
</P
573 >RUNNING THE SERVER AS A DAEMON
</H2
575 >To run the server as a daemon from the command
576 line, simply put the
<EM
579 command line. There is no need to place an ampersand at
580 the end of the command line - the
<EM
583 option causes the server to detach itself from the tty
586 >Any user can run the server as a daemon (execute
587 permissions permitting, of course). This is useful for
588 testing purposes, and may even be useful as a temporary
589 substitute for something like ftp. When run this way, however,
590 the server will only have the privileges of the user who ran
593 >To ensure that the server is run as a daemon whenever
594 the machine is started, and to ensure that it runs as root
595 so that it can serve multiple clients, you will need to modify
596 the system startup files. Wherever appropriate (for example, in
600 >), insert the following line,
601 substituting port number, log file location, configuration file
602 location and debug level as desired:
</P
606 >/usr/local/samba/bin/smbd -D -l /var/adm/smblogs/log
607 -s /usr/local/samba/lib/smb.conf
</B
610 >(The above should appear in your initialization script
611 as a single line. Depending on your terminal characteristics,
612 it may not appear that way in this man page. If the above appears
613 as more than one line, please treat any newlines or indentation
614 as a single space or TAB character.)
</P
616 >If the options used at compile time are appropriate for
617 your system, all parameters except
<EM
620 be omitted. See the section OPTIONS above.
</P
628 >RUNNING THE SERVER ON REQUEST
</H2
630 >If your system uses a meta-daemon such as
<B
634 >, you can arrange to have the smbd server started
635 whenever a process attempts to connect to it. This requires several
636 changes to the startup files on the host machine. If you are
637 experimenting as an ordinary user rather than as root, you will
638 need the assistance of your system administrator to modify the
641 >You will probably want to set up the NetBIOS name server
653 >. To do this refer to the
664 >First, ensure that a port is configured in the file
668 >. The well-known port
139
669 should be used if possible, though any port may be used.
</P
671 >Ensure that a line similar to the following is in
679 >netbios-ssn
139/tcp
</B
682 >Note for NIS/YP users - you may need to rebuild the
683 NIS service maps rather than alter your local
<TT
689 >Next, put a suitable line in the file
<TT
693 > (in the unlikely event that you are using a meta-daemon
694 other than inetd, you are on your own). Note that the first item
695 in this line matches the service name in
<TT
699 >. Substitute appropriate values for your system
707 >netbios-ssn stream tcp nowait root /usr/local/samba/bin/smbd
708 -d1 -l/var/adm/smblogs/log -s/usr/local/samba/lib/smb.conf
</B
711 >(The above should appear in
<TT
715 as a single line. Depending on your terminal characteristics, it may
716 not appear that way in this man page. If the above appears as more
717 than one line, please treat any newlines or indentation as a single
718 space or TAB character.)
</P
720 >Note that there is no need to specify a port number here,
721 even if you are using a non-standard port number.
</P
723 >Lastly, edit the configuration file to provide suitable
724 services. To start with, the following two services should be
735 CLASS=
"COMPUTEROUTPUT"
751 >This will allow you to connect to your home directory
752 and print to any printer supported by the host (user privileges
761 >TESTING THE INSTALLATION
</H2
763 >If running the server as a daemon, execute it before
764 proceeding. If using a meta-daemon, either restart the system
765 or kill and restart the meta-daemon. Some versions of
769 > will reread their configuration
770 tables if they receive a HUP signal.
</P
772 >If your machine's name is fred and your
773 name is mary, you should now be able to connect
780 >To properly test and experiment with the server, we
781 recommend using the
<B
786 HREF=
"smbclient.1.html"
793 and also going through the steps outlined in the file
801 directory of your Samba installation.
</P
811 >This man page is correct for version
2.2 of
822 >Most diagnostics issued by the server are logged
823 in a specified log file. The log file name is specified
824 at compile time, but may be overridden on the command line.
</P
826 >The number and nature of diagnostics available depends
827 on the debug level used by the server. If you have problems, set
828 the debug level to
3 and peruse the log files.
</P
830 >Most messages are reasonably self-explanatory. Unfortunately,
831 at the time this man page was created, there are too many diagnostics
832 available in the source code to warrant describing each and every
833 diagnostic. At this stage your best bet is still to grep the
834 source code and inspect the conditions that gave rise to the
835 diagnostics you are seeing.
</P
845 >Sending the smbd a SIGHUP will cause it to
850 file within a short period of time.
</P
852 >To shut down a users smbd process it is recommended
859 be used, except as a last resort, as this may leave the shared
860 memory area in an inconsistent state. The safe way to terminate
861 an smbd is to send it a SIGTERM (-
15) signal and wait for
862 it to die on its own.
</P
864 >The debug log level of smbd may be raised by sending
867 >kill -USR1
<smbd-pid
></B
869 and lowered by sending it a SIGUSR2 (
<B
871 >kill -USR2
<smbd-pid
>
873 >). This is to allow transient problems to be diagnosed,
874 whilst still running at a normally low log level.
</P
876 >Note that as the signal handlers send a debug write,
877 they are not re-entrant in smbd. This you should wait until
878 smbd is in a state of waiting for an incoming smb before
879 issuing them. It is possible to make the signal handlers safe
880 by un-blocking the signals before the select call and re-blocking
881 them after, however this would affect performance.
</P
904 HREF=
"smb.conf.5.html"
912 HREF=
"smbclient.1.html"
920 HREF=
"testparm.1.html"
927 HREF=
"testprns.1.html"
933 >, and the Internet RFC's
941 In addition the CIFS (formerly SMB) specification is available
942 as a link from the Web page
<A
943 HREF=
"http://samba.org/cifs/"
946 http://samba.org/cifs/
</A
957 >The original Samba software and related utilities
958 were created by Andrew Tridgell. Samba is now developed
959 by the Samba Team as an Open Source project similar
960 to the way the Linux kernel is developed.
</P
962 >The original Samba man pages were written by Karl Auer.
963 The man page sources were converted to YODL format (another
964 excellent piece of Open Source software, available at
966 HREF=
"ftp://ftp.icce.rug.nl/pub/unix/"
968 > ftp://ftp.icce.rug.nl/pub/unix/
</A
969 >) and updated for the Samba
2.0
970 release by Jeremy Allison. The conversion to DocBook for
971 Samba
2.2 was done by Gerald Carter
</P