smbd-向客户提供SMBCIFS服务的服务器
总览 SYNOPSIS
smbd [-D] [-F] [-S] [-i] [-h] [-V] [-b] [-d <debug level>] [-l <log directory>][-p <port number>] [-O <socket option>] [-s <configuration file>]
描述 DESCRIPTION
此程序是Samba(7) 套件的⼀部分。
smbd 是向Windows客户机提供⽂件共享和打印服务的服务器进程。该服务器⽤SMB(或CIFS)协议向客户提供⽂件存放空间和打印服务。它与LanManager协议兼容并能向使⽤此协议的客户提供服务。这些客户端包括MSCLIENT 3.0 for DOS,Windows for
Workgroups,Windows 95/98/ME,Windows NT,Windows 2000, OS/2,DAVE for Macintosh, 和smbfs for Linux。
⽤来控制服务属性的配置⽂件的⼿册页中对服务器可提供的服务进⾏了详细的描述(参见 f (5))。此⼿册不描述提供的服务但集中讲述了对管理服务器运⾏等⽅⾯的问题描述。
请注意对服务器运⾏有关的⾮常重要的安全性问题,同时在进⾏安装处理前也应该仔细阅读f (5)⼿册。
只要有客户请求就会建⽴⼀个对话。对每个对话,每个客户获得服务器的⼀份复本。在对话期间此复本对所有客户产⽣的连接进⾏服务。当来⾃此客户的所有连接都关闭时,此客户的服务器复本也退出。
服务器所包含的配置⽂件和其它任何⽂件都会在每次更改后⾃动重新装⼊。你可以通过对服务器发送⼀个SIGHUP信息来强制⼀次重新装⼊。重新装⼊配置⽂件对已建⽴的任何对服务的连接均⽆效。要么⽤户必须断开服务,要么将smbd进程中⽌并重启。
选项 OPTIONS
-D
如果指定此选项,则服务器以后台进程⽅式运⾏。即,它会分离本⾝并在后台运⾏,在适当的端⼝上监听请求。对于提供⽐临时性的⽂件和打印服务更多内容的服务器,推荐将smbd 以后台进程⽅式运⾏。如果在shell命令⾏运⾏smbd ,将默认使⽤这个选项。
-F
依依惜别
If specified, this parameter caus the main smbd process to not daemonize, i.e. double-fork and disassociate with the terminal. Child process are still created as normal to rvice each connection request, but the main process does not exit. This operation mode is suitable for running smbd under process supervisors such as supervi and svscan from Daniel J. Bernstein's daemontools package, or the AIX process monitor.
-S
If specified, this parameter caus smbd to log to standard output rather than a file.
-i
If this parameter is specified it caus the rver to run "interactively", not as a daemon, even if the rver is executed on the
command line of a shell. Setting this parameter negates the implicit deamon mode when run from the command line. smbd also logs to standard output, as if the -S parameter had been given.
-V
打印smbd的版本号。
-s <configuration file>
指定的⽂件包含了服务器所需的配置细节。此⽂件中的信息包含如所⽤的printcap⽂件这样的服务器详细信息,同时也对服务器所提供的服务进⾏了描述。请参见f (5)⽂件。缺省的配置⽂件名在软件包编译时决定。
-d|--debug=debuglevel怎样形容
debuglevel是⼀个从0到10的整数。如果没有指定此参数则默认的值是0。
如果这个值越⾼,越多关于服务器的详细活动信息将被记录到⽂件中。在0调试级时,只记录紧急错误和严重警告。对于平⽇的运⾏服务,1调试级是个合理的等级,它只产⽣⼩量的关于执⾏操作的信息。
1以上的调试级将产⽣相当多的记录数据,并且只在解决问题时才有⽤。3以上的调试级只被设计为让开发者使⽤并会产⽣极⼤数量的记录数据,⽽且其中很多部分⾮常难以理解。
注意在此使⽤这个参数将越过在f (5)⽂件中的log level参数。
-l|--logfile=logbaname
⽤来记录/调试的⽂件。会⾃动为它添加 ".client" 扩展名。客户端不会将记录⽂件删除。
-h|--help
打印smbd的命令⾏参数(⽤法)。
-b
Prints information about how Samba was built.
-l <log directory>
If specified, log directory specifies a log directory into which the "log.smbd" log file will be created for informational and debug messages from the running rver. The log file generated is never removed by the rver although its size may be controlled by the max log size option in f(5) file. Beware: If the directory specified does not exist, smbd will log to the default debug log location defined at compile time.
The default log directory is specified at compile time.
-p <port number>
白羊座图标port number端⼝号是个正值整数。如果此选项未指定则缺省值为139。
这个端⼝号⽤于从客户端建⽴对服务器的连接。基于TCP上的SMB所⽤的标准(通常使⽤的)端⼝号为139,因此这是缺省值。如果你希望作为普通⽤户⽽不是root⾝份运⾏服务器的话,多数系统会要求你使⽤1024以上的端⼝号 - 如有此情况请向系统管理员取得帮助。
为了使更多客户使⽤服务器,⽽⼜在139以外的端⼝进⾏配置,则你需要在端⼝139上进⾏端⼝重定向,在的4.3.5部分有详细的描述。
除上述情况以外,此选项通常不⽤。
⽂件 FILES
/f
如果通过inetd 超级进程来运⾏服务器,则此⽂件必须含有适当的启动信息。
龙腾飞/etc/rc
(或其它你的系统所⽤的初始化脚本)。
如果在启动时以后台进程模式运⾏服务器,则此⽂件须包含适当的服务器启动次序。
/etc/rvices
如果通过inetd超级进程来运⾏服务器,则此⽂件必须包含⼀份服务端⼝(如139)和协议类型(如tcp)与对应的服务名(如netbios-ssn)的映射。
/usr/local/samba/f
缺省的服务器配置⽂件 f(5)的存放位置。系统安装此⽂件的其它通常位置为/usr/samba/f和/etc/f。
此⽂件描述了客户可获得的服务项的情况。参见f(5)获得更多情况。
限制 LIMITATIONS
在有些系统上,smbd⽆法在⼀次tuid()调⽤以后把uid返回到root。这样的系统称为“陷门”(trapdoor)uid系统。如果你使⽤这样的系统,将⽆法同时在⼀个客户端(如⼀台PC机)以两个不同的⽤户⾝份进⾏连接。试图连接第⼆个⽤户将得到“访问被拒”或类似的结果。
禁言环境变量 ENVIRONMENT VARIABLES
PRINTER
如果对可打印服务没有指定打印名称,多数系统将使⽤此变量(如果未定义此变量则⽤lp )的值作为可⽤打印机的名称。但并不是服务器特定的。
PAM INTERACTION宿舍文化建设方案
Samba us PAM for authentication (when prented with a plaintext password), for account checking (is this account disabled?) and for ssion management. The degree too which samba supports PAM is restricted by the limitations of the SMB protocol and the obey pam f(5) paramater. When this is t, the following restrictions apply:
*
Account Validation: All access to a samba rver are checked against PAM to e if the account is vaild, not disabled and is permitted to login at this time. This also applies to encrypted logins.
*
Session Management: When not using share level cuirty, urs must pass PAM's ssion checks
before access is granted. Note however, that this is bypasd in share level cuirty. Note also that some older pam configuration files may need a line added for ssion support.
写黄山的诗句版本 VERSION
此⼿册页是针对samba套件版本3.0的。
诊断 DIAGNOSTICS
通常情况下诊断信息都记录到指定好的记录⽂件中。这个⽂件的名称是在编译时指定的,但也可以⽤命令⾏来指定。
⽤户可以得到的诊断信息的数量和种类取决于⽤户执⾏客户端程序时所⽤的调试等级。如果你发现有问题的话,把调试级设到3并详细阅读记录⽂件⾥的内容。
很多信息都⽆须加以说明。不幸的是,在写⼿册页时,源代码中有着太多的诊断信息,它们保证了对每种情况都加以描述,却⽆法写⼊⽂档。在此时,你最好还是⽤grep查找源代码并检查引起诊断信息的条件。
信号 SIGNALS
向smbd发送⼀个SIGHUP信号可以使它在⼀个很短时间内重新装⼊f配置⽂件。
慈善信托我们不推荐你使⽤SIGKILL (-9)来终⽌smbd进程除⾮这是最后的⽅法,因为这样做可能导致名字数据库不⼀致。正确的⽅法是发送SIGTERM (-15)信号并等待程序⾃⾏结束。
另外,smbd程序的调试记录等级也可以通过smbcontrol(1) 调⾼或者调低。(向程序发送⼀个SIGUSR1或SIGUSR2信号(kill -USR2 <nmbd-pid>)的⽅法在Samba2.2 中已经不再使⽤。) 通过使⽤这样的⽅法可以诊断⼀些暂时的问题,同时仍然可以在⼀个正常的并且较低的记录等级来运⾏。
Note that as the signal handlers nd a debug write, they are not re-entrant in smbd. This you should wait untilsmbd is in a state of waiting for an incoming SMB before issuing them. It is possible to make the signal handlers safe by un-blocking the signals before the lect call and re-blocking them after, however this would affect performance.