Installing LDAP is not that simple. Some basic LDAP knowledge is needed, but for setting up quickly do;
apt-get install slapd ldap-utils migrationtools
Answer all questions; make sure you enter for the first to screens (DN and org) the same name, for instance domain.com. You don’t have to do this, but if you don’t know anything about LDAP this is advisable, because you’ll get errors like;
ldap_bind: Invalid credentials
Now you can add your /etc/passwd users by migrating them with:
cd /usr/share/migrationtools
./migrate_passwd.pl /etc/passwd /tmp/passwd.ldif
When importing these like:
ldapadd -x -v -D cn=admin,dc=domain,dc=com -w YOURPASSWORD < /tmp/passwd.ldif
You’ll probably get some error like:
parent does not exist
Because your passwd.ldif contains:
ou: Groups
If you want to know why, you should look at an organizational schema of LDAP, but if you don’t care, just make an ldif file like:
dn: ou=People,dc=domain,dc=com
ou: People
objectClass: organizationalUnit
And add it;
ldapadd -x -v -D cn=admin,dc=domain,dc=com -w YOURPASSWORD < /tmp/ou.ldif
Now add the passwd.diff
ldapadd -x -v -D cn=admin,dc=domain,dc=com -w YOURPASSWORD < /tmp/passwd.ldif
and check if all went ok;
/usr/bin/ldapsearch -x -p 389 -h localhost -w YOURPASSWD -D ‘cn=admin,dc=componence,dc=com’ objectClass=*
It should show all you added and set.
Be the first to leave a comment. Don’t be shy.