Sign up ×
Ask Ubuntu is a question and answer site for Ubuntu users and developers. It's 100% free.

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

When I tried to log into the server it says(

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

1 Answer 1

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:   localhost  dexter

Change "dexter" with your hostname.

share|improve this answer
what's the distinction between and They're both loopbacks. – Thufir Jun 18 '14 at 3:30

Your Answer


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.