0

I want to log in with LDAP in my FTP. With the conf file:

<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>

Logging with the user 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/

the log says

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

I really don't know why proftp doesn't find the user2. I'm using CentOS7

4
  • Does the objectClass not need to include objectClass: user? I would change the ldap logging level to include the details of the query being generated
    – Tom
    Aug 22, 2020 at 18:53
  • I made some changes. Actually proftpd is searching a posixAccount and he actually find it: SEARCH RESULT tag=101 err=0 nentries=1 text=
    – Yann
    Aug 23, 2020 at 19:58
  • But also it also search for a serie of information that I didnt't defined SRCH attr=objectClass uid userPassword uidNumber gidNumber gecos homeDirectory loginShell krbPrincipalName cn modifyTimestamp modifyTimestamp shadowLastChange shadowMin shadowMax shadowWarning shadowInactive shadowExpire shadowFlag krbLastPwdChange krbPasswordExpiration pwdAttribute authorizedService accountExpires userAccountControl nsAccountLock host rhost loginDisabled loginExpirationTime loginAllowedTimeMap sshPublicKey userCertificate;binary mail
    – Yann
    Aug 23, 2020 at 19:58
  • result proftpd does not find the actual user
    – Yann
    Aug 23, 2020 at 19:59

1 Answer 1

0

Problem was completely different from the logging says. Activate SystemLog /var/log/proftpd/proftpd.log for appropriate logging issues. I deactivate unix and pam authentification, and let only ldap auth.

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .