我正在尝试使用sasl + ldap来validation颠覆用户。 关于这个问题的其他问题似乎与早期版本的subversion或sasldbauthentication有关。
lsb_release -a No LSB modules are available. Distributor ID: Debian Description: Debian GNU/Linux 8.1 (jessie) Release: 8.1 Codename: jessie svnserve --version svnserve, version 1.8.10 (r1615264) Cyrus SASL authentication is available. saslauthd -v saslauthd 2.1.26 authentication mechanisms: sasldb getpwent kerberos5 pam rimap shadow ldap
sasl + LDAP部分似乎被正确configuration:
testsaslauthd -u user -p password -r realm 0: OK "Success."
使用错误的凭据进行testing会导致错误:
testsaslauthd -u wronguser -p wrongpassword -r wrongrealm 0: NO "authentication failed"
它在auth.log中显示一个错误:
Sep 10 22:23:53 xxx saslauthd[30948]: Entry not found ((&(objectClass=posixAccount)(uid=wronguser))). Sep 10 22:23:53 xxx saslauthd[30948]: Authentication failed for wronguser/wrongrealm: User not found (-6) Sep 10 22:23:53 xxx saslauthd[30948]: do_auth : auth failure: [user=wronguser] [service=imap] [realm=wrongrealm] [mech=ldap] [reason=Unknown]
所以我认为SASL可以很好地联系LDAP服务器并获取数据。
我configuration颠覆与:
/etc/sasl2/svn.conf: pwcheck_method: saslauthd mech_list: DIGEST-MD5
使用strace -e open检查svnserve会显示它打开此文件,而不是/ usr / lib / sasl2或类似文件。
当我尝试从svn客户端连接时,我得到
Sep 10 22:31:38 xxx svnserve: DIGEST-MD5 common mech free
在auth.log每次尝试,但没有信息或从saslauthd错误。
如果我将用户帐户添加到sasldb2:
saslpasswd2 user -u realm Password: password
我可以正确连接从svn客户端。 所以它看起来像sasl使用sasldb2,即使svn和saslauthd的configurationconfigurationLDAP。
解决scheme:我附加了一个debugging器,并通过身份validation。 原来我有两个问题:/ var / log / saslauthd上的权限:
drwx--x--- 2 root sasl 140 Sep 27 09:44 saslauthd
意味着“颠覆”服务器用户需要成为组sasl的一部分。
第二个更复杂:DIGEST-MD5依靠纯文本密码来计算服务器端的散列。 我的LDAP目录存储了SSHAencryption的密码,所以服务器永远不能将客户端的MD5与本地计算的MD5进行比较。 我猜目录可能存储MD5(用户名:realm:密码),但我不确定这是否在sasl中支持,以及如果您有多个领域,将如何pipe理。
我真的不想存储纯文本密码,所以目前的解决scheme是只使用未encryption的身份validation:
# cat /etc/sasl2/svn.conf pwcheck_method: saslauthd mech_list: PLAIN LOGIN
不是一个完美的解决scheme,但似乎现在工作。 我想我会强制ssh + svn外部访问,也许我会投入一些时间到svnserve的TLS支持。
(如果有更多的诊断选项和更好的文档,这将会less得多。