VsFTPd-LDAP-PAM

VsFTPd-LDAP-PAM

可能重复:
VsFTPd - LDAP - PAM

我正在尝试配置 VsFTPd 服务器以再次对 LDAP 服务器进行身份验证。这可能很容易,但由于这是我第一次同时使用 LDAP 和 PAM,因此我遇到了一些困难。VsFTPd 在 Ubuntu Server 11.04 上运行,LDAP 是 10.10 Ubuntu Server 上的 OpenLDAP。VsFTPd 无法连接到 LDAP 服务器,在我的系统日志中我有:

vsftpd: pam_ldap: ldap_simple_bind Can't contact LDAP server

LDAP 服务器正常,因为我可以执行ldapsearch

这是我的/etc/pam.d/vsftpd文件:

auth required pam_listfile.so item=user sense=deny file=/etc/ftpusers onerr=succeed
@include common-account
@include common-session
@include common-auth
auth required pam_ldap.so
account required pam_ldap.so
session required pam_ldap.so
password required pam_ldap.so

这是我的/etc/ldap.conf文件:

base dc=example,dc=com
uri ldapi:///ldap.example.com
ldap_version 3
rootbinddn cn=admin,dc=example,dc=com
pam_password md5
nss_initgroups_ignoreusers a_bunch_of_system_users

有人能帮帮我吗?谢谢。

编辑:关于 Ubuntu Server 的精确度。pam_listfile.so 上的拼写错误

答案1

URI 似乎不正确 - 多了一条斜线。这可能是您收到该消息的原因,因为它根本找不到 ldap 服务器。

它应该是:

base dc=example,dc=com
uri ldapi://ldap.example.com
ldap_version 3
rootbinddn cn=admin,dc=example,dc=com
pam_password md5
nss_initgroups_ignoreusers a_bunch_of_system_users

但是,由于您显然是在本地连接,因此您现在可能应该简单地执行以下操作:

base dc=example,dc=com
uri ldapi://127.0.0.1
ldap_version 3
rootbinddn cn=admin,dc=example,dc=com
pam_password md5
nss_initgroups_ignoreusers a_bunch_of_system_users

相关内容