I am following the server guide for ubuntu 14.04 LTS and I am trying to setup ldap but I have a problem. There is supposed to be a dit named dc=example,dc=com but when I type ldapsearch -x -LLL -H ldap:/// -b dc=example,dc=com dn I get No such object (32) instead of
dn: dc=example,dc=com
dn: cn=admin,dc=example,dc=comlike the guide says i should.
Now after making the add_content.ldif file with the contents listed in the guide and use the command ldapadd -x -D cn=admin,dc=example,dc=com -W -f add_content.ldif with the password I set during installation I get ldap_bind: Invalid credentials (49).
So i guess there is no dc=example,dc=com ldap dit so where is it or how do I make it so i can follow the guide?
1 Answer
I just checked slapd installation on a VM, and it does not create an example DN by default (which is a good thing):
$ ls /etc/ldap/slapd.d
cn=config cn=config.ldif You can either add entries all the way from a base DN, or run sudo dpkg-reconfigure slapd, in which case, you will be greeted with these choices:
- Pick No:
- Use an FQDN (such as
example.com,my.personal.site.org, etc.):Do NOT enter
dc=example,dc=comhere. - Pick some name (e.g., "An example site", "My personal site", etc.):
- When asked for admin password, you're resetting the password to
cn=admin,cn=config. So it's not necessary that you use the password you set while installingslapd. - Use HDB unless you know otherwise. If you don't know what this is, HDB it is.
- Since we don't have a database, pick yes.
- Same here. Move it.
- Do not allow v2 unless you know otherwise. If you don't know what this is, No it is.
A base DN for whatever FQDN you entered will be created.
You can repeated sudo dpkg-reconfigure slapd to reset slapd and start over from scratch at any time.