关于saslauthd 使用的一点擦边球

来源:互联网 发布:淘宝开店心得和经验 编辑:程序博客网 时间:2024/04/30 04:20

由于之前在做openvpn的时候和这次vsftp的时候都利用了saslauthd进行验证测试,使我不禁对这个工具有了兴趣。于是在网上找不到太多资料的情况下,对saslauthd的man 资料进行了汉化,以了解这个工具的具体使用方法。但我这个英语渣还是高估了网络机翻的水平,最后虽有所得,但大部分还是云山雾海。

附渣翻译如下:

///////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////

NAME
     saslauthd - sasl authentication server
     saslauthd - sasl 认证 服务器


SYNOPSIS
大纲
     saslauthd -a authmech [-Tvdchlr] [-O option] [-m mux_path] [-n threads]
               [-s size] [-t timeout]


DESCRIPTION
描述
     saslauthd is a daemon process that handles plaintext authentication requests on behalf of the SASL library.
     saslauthd 是一个利用sasl资料库进行明文身份验证的守护进程


     The server fulfills two roles: it isolates all code requiring superuser privileges into a single process, and it can be used to provide proxy authentication services to clients that do not understand SASL based authentication.
     服务器达到两个目的:它隔离了所有需要超级用户权限的代码到一个单一的过程,它可以用来对不了解SASL认证的客户提供代理认证服务。


     saslauthd should be started from the system boot scripts when going to multi-user mode. When running against a protected authentication database (e.g. the shadow mechanism), it must be run as the superuser.
     当处于多用户模式的时候saslauthd应该从系统脚本启动。当运行受保护的认证数据库(如影子机制),它必须运行在超级用户。


   Options
     选项
     Options named by lower-case letters configure the server itself.
     小写字母命名的选项配置服务器本身。
     Upper-case options control the behavior of specific authentication mecha-nisms; 
     大写选项控制特定的认证机制的行为,
     their applicability to a particular authentication mechanism is described in the AUTHENTICATION MECHANISMS section.
     其适用于特定的认证机制的描述在认证机制部分。


     -a auth mech
认证机构
             Use authmech as the authentication mechanism. (See the AUTHENTICATION MECHANISMS section below.) This parameter is mandatory.
    使用认证机构的认证机制。(见下面的验证机制部分)这个参数是强制性的。
     -O option
选项
             A mechanism specific option (e.g. rimap hostname or config file path)
    一个机制的具体选项(例如rimap主机名或配置文件的路径)
     -H hostname
主机名
             The remote host to be contacted by the rimap authentication mechanism. (Depricated, use -O instead)
    通过rimap验证机制进行联系的远程主机,(depricated,用O代替)
     -m path
路径
             Use path as the pathname to the named socket to listen on for connection requests. 
    用路径来标明侦听连接请求的套接字名称   
    This must be an absolute pathname,and MUST NOT include the trailing "/mux". 
    这必须是一个绝对路径,不包括尾部的"/mux"。
    Note that the default for this value is "/var/state/saslauthd" (or what was specified at compile time) and that this directory must exist for saslauthd to function.
    注意,这个值默认为 "/var/state/saslauthd"(或在编译时指定),而这个目录必须存在且为saslauthd函数所识别。


     -n threads
线索
             Use threads processes for responding to authentication queries.
    使用线性进程响应身份验证查询。
             (default: 5)  A value of zero will indicate that saslauthd should fork an individual process for each connection.  This can solve leaks that occur in some deployments..
     (默认为:5)零值表明saslauthd应该叉为每个连接一个单独的进程。在一些部署这可以解决发生泄漏。


     -s size
大小
             Use size as the table size of the hash table (in kilobytes)
    使用大小为哈希表的表的大小(KB)


     -t timeout
超时时间
             Use timeout as the expiration time of the authentication cache (in seconds)
    使用超时作为验证缓存的过期时间
(以秒为单位)


     -T      Honour time-of-day login restrictions.
             登录时间限制


     -h      Show usage information
    显示使用信息


     -c      Enable cacheing of authentication credentials
             启用缓存的认证证书


     -l      Disable the use of a lock file for controlling access to accept().
    禁止使用访问控制中已经加了锁的文件
             
     -r      Combine the realm with the login (with an ’@’ sign in between).
    结合域与登录(与' @ '之间的标志)。
             e.g.  login: "foo" realm: "bar" will get passed as login:
    例如,登录:“foo”的域:“bar”会通过登录:(一般来说应该是 用户名@域名,所以对这里有疑)
             "foo@bar".  Note that the realm will still be passed, which may lead to unexpected behavior.
    "foo@bar".  注意这个领域仍然会通过,这可能会导致意想不到的行为。(其实也就是说可能真的会通过,但不要做奇怪的事情)


     -v      Print the version number and available authentication mechanisms on standard error, then exit.
    在标准错误上打印版本号和可用的身份验证机制,然后退出。


     -d      Debugging mode.
    调试模式


   Logging
    登录
     saslauthd logs it’s activities via syslogd using the LOG_AUTH facility.
     saslauthd日志的活动利用syslogd log_auth 设施。


AUTHENTICATION MECHANISMS
认证机制
     saslauthd supports one or more "authentication mechanisms", dependent upon the facilities provided by the underlying operating system.  
     saslauthd支持一个或多个“认证机制”,依赖于由底层操作系统提供的设施。
     The mechanism is selected by the -aho flag from the following list of choices:
     机制选择由 -aho 标志 从以下列表中选择:


     dce        (AIX)


                Authenticate using the DCE authentication environment.
验证使用DCE认证环境


     getpwent   (All platforms)


                Authenticate using the getpwent() library function. Typically this authenticates against the local password file. See your systems getpwent(3) man page for details.
验证使用getpwent()库函数。这通常对本地密码文件认证。看看你的系统(3)的人getpwent详情页。


     kerberos4  (All platforms)


                Authenticate against the local Kerberos 4 realm. (See the NOTES section for caveats about this driver.)
验证本地Kerberos 4领域。(见有关此驱动器。说明注解部分)

     kerberos5  (All platforms)


                Authenticate against the local Kerberos 5 realm.
验证本地的Kerberos 5领域


     pam        (Linux, Solaris)


                Authenticate using Pluggable Authentication Modules (PAM).
验证使用可插拔认证模块(PAM)


     rimap      (All platforms)


                Forward authentication requests to a remote IMAP server. This driver connects to a remote IMAP server, specified using the -O flag, and attempts to login (via an IMAP ‘LOGIN’ command) using the credentials supplied to the local server. If the remote authentication succeeds the local connection is also considered to be authenticated. The remote connection is closed as soon as the tagged response from the ‘LOGIN’ command is received from the remote server.
身份验证请求转发到远程服务器。这个驱动程序连接到远程服务器,使用-o标志指定,并尝试登录(通过IMAP“登录”命令)使用提供给本地服务器的凭据。如果远程身份验证成功,则本地连接也被认为是经过身份验证的。一旦从远程服务器接收到来自“登录”命令的标记响应,远程连接就关闭。


                The option parameter to the -O flag describes the remote server to forward authentication requests to.  hostname can be a hostname (imap.example.com) or a dotted-quad IP address (192.168.0.1). The latter is useful if the remote server is multi-homed and has network interfaces that are unreachable from the local IMAP server. The remote host is contacted on the ‘imap’ service port. A non-default port can be specified by appending a slash and the port name or number to the hostname argument.
向O标志的选项参数描述远程服务器将验证请求转发到。主机可以是一个主机名(IMAP。例子。com)或星罗棋布的IP地址(192.168.0.1)。如果远程服务器是多宿主,是无法从当地的IMAP服务器网络接口,后者是有用的。远程主机联系的IMAP服务端口。非默认端口可以通过附加一个斜线和港口名称或编号的主机名参数指定。


                The -O flag and argument are mandatory when using the rimap mechanism.
-O标志和 argument在使用rimap认证的时候是强制使用的


     shadow     (AIX, Irix, Linux, Solaris)


                Authenticate against the local "shadow password file".  The exact mechanism is system dependent.  saslauthd currently understands the getspnam() and getuserpw() library routines.
对本地“影子密码文件”进行身份验证。确切的机制是系统相关的。目前了解getspnam()和getuserpw() saslauthd库例程。
                Some systems honour the -T flag.
有的系统可以用-T 标志


     sasldb     (All platforms)


                Authenticate against the SASL authentication database.  Note that this is probabally not what you want to be using, and is even disabled at compile-time by default.  If you want to use sasldb with the SASL library, you probably want to use the pwcheck_method of "auxprop" along with the sasldb auxprop plugin instead.
验证SASL认证数据库。请注意,这可能不是你要使用,甚至禁用默认的编译时间。如果你想使用sasldb与SASL库,你可能想使用pwcheck_method“auxprop”随着sasldb auxprop插件代替。


     ldap       (All platforms that support OpenLDAP 2.0 or higher)


                Authenticate against an ldap server.  The ldap configuration parameters are read from /etc/saslauthd.conf.  The location of this file can be changed with the -O parameter. See the LDAP_SASLAUTHD file included with the distribution for the list of available parameters.
验证一个LDAP服务器。LDAP配置参数读取/etc/saslauthd.conf。这个文件的位置可以使用-O参数改变。查看这个ldap_saslauthd文件包含有关可用的参数列表中的分布。


     sia        (Digital UNIX)


                Authenticate using the Digital UNIX Security Integration Architecture (a.k.a.  "enhanced security").
验证使用Digital UNIX安全集成架构(又名“增强安全性”)。


NOTES
注意
     The kerberos4 authentication driver consumes considerable resources. 
     kerberos4认证的驱动程序消耗大量资源。 
     To perform an authentication it must obtain a ticket granting ticket from the TGT server on every authentication request. 
     执行认证必须从每一个认证请求的目标服务器得到权限授与(这里非权限即证书,暂不清楚,这里我理解不明确)。
     The Kerberos library routines that obtain the TGT also create a local ticket file, on the reasonable assumption that you will want to save the TGT for use by other Kerberos applications. 
     Kerberos库程序得到TGT也会在本地创建一个证明文件,假设要你保存的TGT用于其他Kerberos应用
     These ticket files are unusable by saslauthd , however there is no way not to create them. 
     这些票的文件无法使用saslauthd,但是没有办法不创建它们。
     The overhead of creating and removing these ticket files can cause serious performance degradation on busy servers. 
     创建和删除这些证明文件的开销会导致繁忙服务器上严重的性能下降。
     (Kerberos was never intended to be used in this manner,anyway.)
     (Kerberos是不会以这种方式使用,无论如何。)


FILES
     /var/run/saslauthd/mux  The default communications socket.
    默认通信套接字。


     /etc/saslauthd.conf     The default configuration file for ldap support.
    LDAP支持默认的配置文件

///////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////


现在基本能使的方法有两种:

/etc/sysconfig/saslauthd 中 MECH=pam

则 测试以pam为验证模块的服务——暂时估且这么说。

使用格式:testsaslauthd -u 用户 -p 密码 -s 服务名

只要是以pam做为服务验证模块的都可以使用用。我已经在openvpn,vsftp的两种虚拟用户的方式(文件数据库,mysql数据库)都已经验证过。

如果用户名和密码能通过服务验证的话,会返回" 0: OK 'Success. ' "


/etc/sysconfig/saslauthd 中 MECH=shadow

这个可以测试系统用户的用户名和密码对应关系。

使用格式:testsaslauthd -u 用户 -p 密码


这里用户名和密码都应该是明码,saslauthd并不直接支持加密的密码进行验证。

///////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////

暂时就是以上所得,网上查过,好像可以用于验证邮件服务器,我估计可能要把MECH改成rimap,但手边没有,也就无从测试了。


现在对saslauthd还是云山雾海,盼有人指导,如有中文资料也请各位赐教。

先行谢过!


0 0
原创粉丝点击