【问题标题】:SASL LDAP authentication failureSASL LDAP 身份验证失败
【发布时间】:2016-08-20 19:50:39
【问题描述】:

尝试使用SASL AND LDAPRedHat Linux 中的用户进行身份验证。到目前为止,我已经设置了saslauthd 服务并启动并运行。我的/etc/saslauthd.conf 如下所示:

ldap_servers: ldaps://test.ldap.server:1234
ldap_use_sasl: yes
ldap_mech: DIGEST-MD5
ldap_auth_method: fastbind
ldap_search_base: Ou=PeopleAuthSrch,DC=abc,DC=com

我的/etc/sasl2/smtpd.conf 如下所示:

pwcheck_method: saslauthd
mech_list: plain login

现在,当我尝试使用以下命令测试身份验证时:

testsaslauthd -u username -p password -f /var/run/saslauthd/mux

我收到0: NO "authentication failed"

当我查看日志时,它说:

Retrying authentication
do_auth   :auth failure: [user:myuser]  [service=imap] [realm=] [mech=ldap] [reason=unknown]

我在这里缺少什么?提前谢谢!!

更新:

安装 OpenLdap 以使用以下命令进行搜索:

ldapsearch -x -h ldaps://my.ldap.server:port -d8

为了让 ldapsearch 命令正常工作,我修改了 /etc/openldap/ldap.conf 文件如下:

tls_reqcert allow
TLS_CACERTDIR /home/myuser/cacertss
LDAPTLS_CACERT /home/myuser/cacertss

它返回所有条目,但我仍然无法使用身份验证

testsaslauthd -u 用户名 -p 密码 -f /var/run/saslauthd/mux

我需要在这里做什么才能通过身份验证?

【问题讨论】:

    标签: authentication ldap sasl


    【解决方案1】:

    经过 5 天的奋斗,我发现我使用的设置是针对 Active directory 的,而我应该使用 LDAP 的设置,如下所示:

    ldap_servers: ldaps://test.ldap.server:1234
    ldap_search_base: Ou=PeopleAuthSrch,DC=abc,DC=com
    ldap_filters: (uid=%u)
    ldap_tls_cacert_file: /path/to/my/certificate
    

    我确实安装了cyrus-sasl-md5,正如 Bertold Kolics 提到的那样,我不确定这是否在验证用户方面发挥了作用。

    【讨论】:

      【解决方案2】:

      我在 RedHat Linux 7.2 上完成了使用 OpenLDAP 和 TLS 设置 SASL 设置的练习,我设法让类似的东西正常工作。

      正如我在上一篇文章中提到的,请确保您已安装 cyrus-sasl-md5 软件包。

      我会首先尝试在没有 SSL 的情况下让一切正常工作。只有在您的设置在没有 SSL 的情况下工作后才移动到 SSL 部分。

      • 你需要确保saslauthd接受CA证书 LDAP 服务器使用的证书。特别是,
        /etc/saslauthd.conf 中的ldap_tls_cacert_file 选项是你的朋友
      • 如果您启用了 SELinux,请确保 saslauthd 可以访问证书文件。如果您不确定,请跟踪/var/log/audit/audit.log 文件并查找带有“denied”关键字的条目。我发现audit2allow 工具是启用以前被拒绝的访问的好方法。您也可以使用 setenforce Permissive 命令暂时禁用 SELinux

      【讨论】:

      • 我安装了cyrus-sasl-md5 重新启动了saslauthd 并确保ldap_tls_cacert_file 指向ldap 使用的证书。我还查看了/var/log/audit/audit.log,我没有看到任何被拒绝的东西。但是我仍然有同样的问题。登录/var/log/messages/ 里面除了我上面提到的内容之外并没有说太多。有什么想法吗?
      • 这在没有 SSL 的情况下可以工作吗?如果是这样,那么它是一个 SSL 问题。您也可以尝试更新系统默认信任的 CA 证书。查找命令update-ca-certs 和/或在/etc/pki/ca-trust/ 目录中四处寻找。
      猜你喜欢
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2020-04-14
      • 2015-04-19
      • 2016-02-05
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      相关资源
      最近更新 更多