Take the 2-minute tour ×
Ask Ubuntu is a question and answer site for Ubuntu users and developers. It's 100% free, no registration required.

I'm trying to follow the Ubuntu official OpenLDAPServer guide with no success.

When I tried to log into the server it says( https://help.ubuntu.com/12.10/serverguide/openldap-server.html#openldap-server-populate):

root@dexter:~# ldapadd -x -D cn=admin,dc=example,dc=com -W -f add_content.ldif
Enter LDAP Password: 
ldap_bind: Invalid credentials (49)

Also when I try to get the dc=example,dc=com DIT:

root@dexter:~# ldapsearch -x -LLL -H ldap:/// -b dc=example,dc=com dn
No such object (32)

Any ideas? I've reinstalled the service three times and I'm completly sur that the password is fine.

share|improve this question
    
Is the base DN really dc=example,dc=com? Or did you change it during package install? What's the output of sudo ls -l /etc/ldap/slapd.d/? –  Eric Carvalho May 13 '13 at 12:58
    
@ericcarvalho you're right, but according to the doc this should be created...root@dexter:~# sudo ls -l /etc/ldap/slapd.d/ total 8 drwxr-x--- 3 openldap openldap 4096 may 14 09:32 cn=config -rw------- 1 openldap openldap 478 may 14 09:32 cn=config.ldif –  user130209 May 14 '13 at 7:43
add comment

1 Answer

The issue was the file /etc/hosts, I had several entries for my localhost and the installation didn't create the Base DN.

TO fix that clean your /etc/hosts:

127.0.0.1   localhost
127.0.1.1       dexter.example.com  dexter

Change "dexter" with your hostname.

share|improve this answer
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.