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 directory
>] [-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
<B
104 > killed and restarted.
</P
122 >If specified, this parameter causes
123 the server to operate as a daemon. That is, it detaches
124 itself and runs in the background, fielding requests
125 on the appropriate port. Operating the server as a
126 daemon is the recommended way of running
<B
130 servers that provide more than casual use file and
131 print services. This switch is assumed if
<B
135 > is executed on the command line of a shell.
142 >If this parameter is specified, each new
143 connection will append log messages to the log file.
144 This is the default.
</P
150 >If this parameter is specified, the
151 log files will be overwritten when opened. By default,
155 > will append entries to the log
162 >Passive option. Causes
<B
166 send any network traffic out. Used for debugging by
167 the developers only.
</P
173 >Prints the help information (usage)
183 >Prints the version number for
190 >-d
<debug level
></DT
199 from
0 to
10. The default value if this parameter is
200 not specified is zero.
</P
202 >The higher this value, the more detail will be
203 logged to the log files about the activities of the
204 server. At level
0, only critical errors and serious
205 warnings will be logged. Level
1 is a reasonable level for
206 day to day running - it generates a small amount of
207 information about operations carried out.
</P
209 >Levels above
1 will generate considerable
210 amounts of log data, and should only be used when
211 investigating a problem. Levels above
3 are designed for
212 use only by developers and generate HUGE amounts of log
213 data, most of which is extremely cryptic.
</P
215 >Note that specifying this parameter here will
217 HREF=
"smb.conf.5.html#loglevel"
221 > parameter in the
<A
222 HREF=
"smb.conf.5.html"
231 >-l
<log directory
></DT
241 specifies a log directory into which the
"log.smbd" log
242 file will be created for informational and debug
243 messages from the running server. The log
244 file generated is never removed by the server although
245 its size may be controlled by the
<A
246 HREF=
"smb.conf.5.html#maxlogsize"
251 HREF=
"smb.conf.5.html"
260 >The default log directory is specified at
264 >-O
<socket options
></DT
268 HREF=
"smb.conf.5.html#socketoptions"
273 HREF=
"smb.conf.5.html"
280 > file for details.
</P
283 >-p
<port number
></DT
291 > is a positive integer
292 value. The default value if this parameter is not
295 >This number is the port number that will be
296 used when making connections to the server from client
297 software. The standard (well-known) port number for the
298 SMB over TCP is
139, hence the default. If you wish to
299 run the server as an ordinary user rather than
300 as root, most systems will require you to use a port
301 number greater than
1024 - ask your system administrator
302 for help if you are in this situation.
</P
304 >In order for the server to be useful by most
305 clients, should you configure it on a port other
306 than
139, you will require port redirection services
307 on port
139, details of which are outlined in rfc1002.txt
310 >This parameter is not normally specified except
311 in the above situation.
</P
314 >-s
<configuration file
></DT
317 >The file specified contains the
318 configuration details required by the server. The
319 information in this file includes server-specific
320 information such as what printcap file to use, as well
321 as descriptions of all the services that the server is
323 HREF=
"smb.conf.5.html"
329 > for more information.
330 The default configuration file name is determined at
355 >If the server is to be run by the
359 > meta-daemon, this file
360 must contain suitable startup information for the
361 meta-daemon. See the section INSTALLATION below.
371 >or whatever initialization script your
374 >If running the server as a daemon at startup,
375 this file will need to contain an appropriate startup
376 sequence for the server. See the section INSTALLATION
386 >If running the server via the
391 must contain a mapping of service name (e.g., netbios-ssn)
392 to service port (e.g.,
139) and protocol type (e.g., tcp).
393 See the section INSTALLATION below.
</P
398 >/usr/local/samba/lib/smb.conf
</TT
402 >This is the default location of the
404 HREF=
"smb.conf.5.html"
411 server configuration file. Other common places that systems
412 install this file are
<TT
414 >/usr/samba/lib/smb.conf
</TT
421 >This file describes all the services the server
422 is to make available to clients. See
<A
423 HREF=
"smb.conf.5.html"
429 > for more information.
</P
445 > cannot change uid back
446 to root after a setuid() call. Such systems are called
447 trapdoor uid systems. If you have such a system,
448 you will be unable to connect from a client (such as a PC) as
449 two different users at once. Attempts to connect the
450 second user will result in access denied or
459 >ENVIRONMENTVARIABLES
</H2
472 >If no printer name is specified to
473 printable services, most systems will use the value of
474 this variable (or
<TT
477 > if this variable is
478 not defined) as the name of the printer to use. This
479 is not specific to the server, however.
</P
492 >The location of the server and its support files
493 is a matter for individual system administrators. The following
494 are thus suggestions only.
</P
496 >It is recommended that the server software be installed
499 >/usr/local/samba/
</TT
501 in a directory readable by all, writeable only by root. The server
502 program itself should be executable by all, as users may wish to
503 run the server themselves (in which case it will of course run
504 with their privileges). The server should NOT be setuid. On some
505 systems it may be worthwhile to make
<B
508 > setgid to an empty group.
509 This is because some systems may have a security hole where daemon
510 processes that become a user can be attached to with a debugger.
514 > file setgid to an empty group may prevent
515 this hole from being exploited. This security hole and the suggested
516 fix has only been confirmed on old versions (pre-kernel
2.0) of Linux
517 at the time this was written. It is possible that this hole only
518 exists in Linux, as testing on other systems has thus far shown them
521 >The server log files should be put in a directory readable and
522 writeable only by root, as the log files may contain sensitive
525 >The configuration file should be placed in a directory
526 readable and writeable only by root, as the configuration file
527 controls security for the services offered by the server. The
528 configuration file can be made readable by all if desired, but
529 this is not necessary for correct operation of the server and is
530 not recommended. A sample configuration file
<TT
534 > is supplied with the source to the server - this may
538 > and modified to suit
541 >The remaining notes will assume the following:
</P
550 > (the server program)
553 >/usr/local/samba/bin
</TT
562 file) installed in
<TT
564 >/usr/local/samba/lib
</TT
569 >log files stored in
<TT
577 >The server may be run either as a daemon by users
578 or at startup, or it may be run from a meta-daemon such as
582 > upon request. If run as a daemon,
583 the server will always be ready, so starting sessions will be
584 faster. If run from a meta-daemon some memory will be saved and
585 utilities such as the tcpd TCP-wrapper may be used for extra
586 security. For serious use as file server it is recommended
590 > be run as a daemon.
</P
592 >When you've decided, continue with either
</P
598 >RUNNING THE SERVER AS A DAEMON or
</P
602 >RUNNING THE SERVER ON REQUEST.
</P
612 >RUNNING THE SERVER AS A DAEMON
</H2
614 >To run the server as a daemon from the command
615 line, simply put the
<EM
618 command line. There is no need to place an ampersand at
619 the end of the command line - the
<EM
622 option causes the server to detach itself from the tty
625 >Any user can run the server as a daemon (execute
626 permissions permitting, of course). This is useful for
627 testing purposes, and may even be useful as a temporary
628 substitute for something like ftp. When run this way, however,
629 the server will only have the privileges of the user who ran
632 >To ensure that the server is run as a daemon whenever
633 the machine is started, and to ensure that it runs as root
634 so that it can serve multiple clients, you will need to modify
635 the system startup files. Wherever appropriate (for example, in
639 >), insert the following line,
640 substituting port number, log file location, configuration file
641 location and debug level as desired:
</P
645 >/usr/local/samba/bin/smbd -D -l /var/adm/smblogs/log
646 -s /usr/local/samba/lib/smb.conf
</B
649 >(The above should appear in your initialization script
650 as a single line. Depending on your terminal characteristics,
651 it may not appear that way in this man page. If the above appears
652 as more than one line, please treat any newlines or indentation
653 as a single space or TAB character.)
</P
655 >If the options used at compile time are appropriate for
656 your system, all parameters except
<EM
659 be omitted. See the section OPTIONS above.
</P
667 >RUNNING THE SERVER ON REQUEST
</H2
669 >If your system uses a meta-daemon such as
<B
673 >, you can arrange to have the
<B
677 whenever a process attempts to connect to it. This requires several
678 changes to the startup files on the host machine. If you are
679 experimenting as an ordinary user rather than as root, you will
680 need the assistance of your system administrator to modify the
683 >You will probably want to set up the NetBIOS name server
695 >. To do this refer to the
706 >First, ensure that a port is configured in the file
710 >. The well-known port
139
711 should be used if possible, though any port may be used.
</P
713 >Ensure that a line similar to the following is in
721 >netbios-ssn
139/tcp
</B
724 >Note for NIS/YP users - you may need to rebuild the
725 NIS service maps rather than alter your local
<TT
731 >Next, put a suitable line in the file
<TT
735 > (in the unlikely event that you are using a meta-daemon
736 other than inetd, you are on your own). Note that the first item
737 in this line matches the service name in
<TT
741 >. Substitute appropriate values for your system
749 >netbios-ssn stream tcp nowait root /usr/local/samba/bin/smbd
750 -d1 -l/var/adm/smblogs/log -s/usr/local/samba/lib/smb.conf
</B
753 >(The above should appear in
<TT
757 as a single line. Depending on your terminal characteristics, it may
758 not appear that way in this man page. If the above appears as more
759 than one line, please treat any newlines or indentation as a single
760 space or TAB character.)
</P
762 >Note that there is no need to specify a port number here,
763 even if you are using a non-standard port number.
</P
765 >Lastly, edit the configuration file to provide suitable
766 services. To start with, the following two services should be
777 CLASS=
"COMPUTEROUTPUT"
793 >This will allow you to connect to your home directory
794 and print to any printer supported by the host (user privileges
805 >Samba uses PAM for authentication (when presented with a plaintext
806 password), for account checking (is this account disabled?) and for
807 session management. The degree too which samba supports PAM is restricted
808 by the limitations of the SMB protocol and the
810 HREF=
"smb.conf.5.html#OBEYPAMRESRICTIONS"
812 >obey pam restricions
</A
814 smb.conf paramater. When this is set, the following restrictions apply:
822 >Account Validation
</EM
823 >: All acccesses to a
824 samba server are checked
825 against PAM to see if the account is vaild, not disabled and is permitted to
826 login at this time. This also applies to encrypted logins.
832 >Session Management
</EM
833 >: When not using share
834 level secuirty, users must pass PAM's session checks before access
835 is granted. Note however, that this is bypassed in share level secuirty.
836 Note also that some older pam configuration files may need a line
837 added for session support.
848 >TESTING THE INSTALLATION
</H2
850 >If running the server as a daemon, execute it before
851 proceeding. If using a meta-daemon, either restart the system
852 or kill and restart the meta-daemon. Some versions of
856 > will reread their configuration
857 tables if they receive a HUP signal.
</P
859 >If your machine's name is
<TT
870 >, you should now be able to connect
877 >To properly test and experiment with the server, we
878 recommend using the
<B
883 HREF=
"smbclient.1.html"
890 and also going through the steps outlined in the file
898 directory of your Samba installation.
</P
908 >This man page is correct for version
2.2 of
919 >Most diagnostics issued by the server are logged
920 in a specified log file. The log file name is specified
921 at compile time, but may be overridden on the command line.
</P
923 >The number and nature of diagnostics available depends
924 on the debug level used by the server. If you have problems, set
925 the debug level to
3 and peruse the log files.
</P
927 >Most messages are reasonably self-explanatory. Unfortunately,
928 at the time this man page was created, there are too many diagnostics
929 available in the source code to warrant describing each and every
930 diagnostic. At this stage your best bet is still to grep the
931 source code and inspect the conditions that gave rise to the
932 diagnostics you are seeing.
</P
945 > a SIGHUP will cause it to
950 file within a short period of time.
</P
952 >To shut down a user's
<B
955 > process it is recommended
962 be used, except as a last resort, as this may leave the shared
963 memory area in an inconsistent state. The safe way to terminate
967 > is to send it a SIGTERM (-
15) signal and wait for
968 it to die on its own.
</P
970 >The debug log level of
<B
975 HREF=
"smbcontrol.1.html"
982 > program (SIGUSR[
1|
2] signals are no longer used in
983 Samba
2.2). This is to allow transient problems to be diagnosed,
984 whilst still running at a normally low log level.
</P
986 >Note that as the signal handlers send a debug write,
987 they are not re-entrant in
<B
990 >. This you should wait until
994 > is in a state of waiting for an incoming SMB before
995 issuing them. It is possible to make the signal handlers safe
996 by un-blocking the signals before the select call and re-blocking
997 them after, however this would affect performance.
</P
1007 >hosts_access(
5),
<B
1020 HREF=
"smb.conf.5.html"
1028 HREF=
"smbclient.1.html"
1036 HREF=
"testparm.1.html"
1043 HREF=
"testprns.1.html"
1049 >, and the Internet RFC's
1057 In addition the CIFS (formerly SMB) specification is available
1058 as a link from the Web page
<A
1059 HREF=
"http://samba.org/cifs/"
1062 http://samba.org/cifs/
</A
1073 >The original Samba software and related utilities
1074 were created by Andrew Tridgell. Samba is now developed
1075 by the Samba Team as an Open Source project similar
1076 to the way the Linux kernel is developed.
</P
1078 >The original Samba man pages were written by Karl Auer.
1079 The man page sources were converted to YODL format (another
1080 excellent piece of Open Source software, available at
1082 HREF=
"ftp://ftp.icce.rug.nl/pub/unix/"
1084 > ftp://ftp.icce.rug.nl/pub/unix/
</A
1085 >) and updated for the Samba
2.0
1086 release by Jeremy Allison. The conversion to DocBook for
1087 Samba
2.2 was done by Gerald Carter
</P