Set up an ldap server

From Linuxintro
Revision as of 17:09, 1 September 2008 by imported>ThorstenStaerk (→‎query ldap server)

For SUSE

install ldap server

Just follow http://en.opensuse.org/Howto_LDAP_server

test ldap server

initialize ldap server

See http://ubuntuforums.org/showthread.php?p=1582401

add an entry

See http://ubuntuforums.org/showthread.php?p=1582401

Restart ldap server

Restarting ldap server must be possible:

/etc/init.d/ldap stop
/etc/init.d/ldap start

Now the command

/etc/init.d/ldap status

Should show running. The port must be reachable via network:

nmap localhost

Should show one line

389/tcp  open  ldap

Adding an OU

To add an organizational unit, do

cat >orgunit<<EOF
dn: ou=orgunit1,dc=example,dc=com
objectClass: top
objectClass: organizationalUnit
ou: orgunit1
description: Test orgUnit
EOF
slapadd -v -l test

This example assumes you chose dc=example,dc=com as base DN.

Adding a person

cat >person<<EOF
dn: cn=John Johnson,ou=orgunit1,dc=example,dc=com
objectclass: top
objectclass: person
objectclass: organizationalPerson
sn: John
cn: John Johnson
EOF
slapadd -v -l person

Using an application

You can now test your ldap server using e.g. kaddressbook.

connect to ldap server

Use kaddressbook to connect to an ldap server, search for Sam. The expected entry is Sam Smith.