ProFTP 找不到 LDAP 用戶

ProFTP 找不到 LDAP 用戶

我想在 FTP 中使用 LDAP 登入。使用conf檔:

<IfModule mod_ldap.c>
        LDAPLog /var/log/proftpd/ldap.log
        LDAPProtocolVersion 3
        DebugLevel 3
        LDAPAuthBinds on

        LDAPServer ldap://localhost
        LDAPBindDN "cn=admin,dc=example,dc=com" "pass"
        LDAPUsers "ou=example.com,ou=Domains,dc=example,dc=com" "(uid=%u)"

        LDAPSearchScope subtree

        LDAPGenerateHomedir off
        LDAPGenerateHomedirPrefix /var/mediaserver
</IfModule>

使用使用者 user2 進行日誌記錄

# user2, example.com, Domains, example.com
dn: uid=user2,ou=example.com,ou=Domains,dc=example,dc=com
objectClass: person
objectClass: organizationalPerson
objectClass: inetOrgPerson
objectClass: top
objectClass: qmailUser
cn: yann example
mail: [email protected]
sn: Gailard
qmailGID: 5000
qmailUID: 5000
uid: user2
userPassword:: e1NTSEF9NXJNTS8zZjhLaTEzSXlhckdUdHd6aWVvVHU3S01nd2M=
mailMessageStore: /var/vmail/example.com/user2/

日誌說

2020-08-22 17:53:15,397 mod_ldap/2.9.4[42030]: generated filter ou=example.com,ou=Domains,dc=example,dc=com from template ou=example.com,ou=Domains,dc=example,dc=com and value user2
2020-08-22 17:53:15,397 mod_ldap/2.9.4[42030]: generated filter (uid=user2) from template (uid=%u) and value user2
2020-08-22 17:53:15,398 mod_ldap/2.9.4[42030]: attempting connection to URL ldap://localhost
2020-08-22 17:53:15,398 mod_ldap/2.9.4[42030]: set LDAP protocol version to 3
2020-08-22 17:53:15,398 mod_ldap/2.9.4[42030]: connected to URL ldap://localhost
2020-08-22 17:53:15,400 mod_ldap/2.9.4[42030]: successfully bound as DN 'cn=admin,dc=example,dc=com' with password (see config)
2020-08-22 17:53:15,400 mod_ldap/2.9.4[42030]: set dereferencing to 0
2020-08-22 17:53:15,400 mod_ldap/2.9.4[42030]: set query timeout to 5 secs
2020-08-22 17:53:15,400 mod_ldap/2.9.4[42030]: searched under base DN ou=example.com,ou=Domains,dc=example,dc=com using filter (uid=user2)
2020-08-22 17:53:15,400 mod_ldap/2.9.4[42030]: no entries for filter (uid=user2) under base DN ou=example.com,ou=Domains,dc=example,dc=com
2020-08-22 17:53:19,361 mod_ldap/2.9.4[42030]: connection successfully unbound
2020-08-22 17:53:19,362 mod_ldap/2.9.4[42030]: not unbinding to an already unbound connection

我真的不知道為什麼proftp找不到user2。我用的是CentOS7

答案1

問題與日誌記錄完全不同。啟動SystemLog /var/log/proftpd/proftpd.log適當的日誌記錄問題。我停用 unix 和 pam 身份驗證,只允許 ldap 身份驗證。

相關內容