Skip to content

LDAP Server

cgerloff edited this page Jun 23, 2011 · 16 revisions

To use a TU BS LDAP Server, try this settings:

Host: ldapk5.tu-bs.de

Port: 389

Security: None

BaseDN: ou=people, dc=tu-bs, dc=de


Installation tutorial (LDAP Server): OS: Ubuntu 11.04

apt-get install slapd ldap-utils
dpkg-reconfigure slapd

Answer following dialogue like this:

Omit OpenLDAP server configuration? ... No
DNS domain name: ... debuntu.local
Name of your organization: ... Whatever & Co
Admin Password: XXXXX
Confirm Password: XXXXX
OK
BDB
Do you want your database to be removed when slapd is purged? ... No
Move old database? ... Yes
Allow LDAPv2 Protocol? ... No

Server should be running by now. You can start creating the tree structure and fill it with entries with:

ldapadd -x -W -D "cn=admin,dc=debuntu,dc=local" -f ~/structure.ldif

structure.ldif could look like this to create tree structures:

structure.ldif:

dn: ou=People,dc=debuntu,dc=local
ou: People
objectClass: organizationalUnit

dn: ou=private_People,dc=debuntu,dc=local
ou: private_People
objectClass: organizationalUnit

The .ldif file could also look like this to add an entry:

add_entry.ldif:

dn: uid=mmustermann,ou=People,dc=debuntu,dc=local
uid: mmustermann
cn: Max Mustermann
sn: Mustermann
givenName: Max
displayName: Max Mustermann
mail: [email protected]
telephoneNumer: 1234/45678
userPassword: jn2b3400923b4
objectClass: inetOrgPerson
objectClass: top
objectClass: person

To edit the access control you have to edit following file:

/etc/ldap/slapd.d/cn=config/olcDatabase={1}bdb.ldif

Here are some example entries:

[...]
olcAccess: {0} to * by self write by "cn=admin,dc=debuntu,dc=local" write
olcAccess: {1} to dn.subtree="ou=private_People,dc=debuntu,dc=local" by "uid=mmustermann,ou=People,dc=debuntu,dc=local" write
[...]

Other useful commands:

slapcat (shows all entries of the ldap if you are on your host)
ldapsearch (Example: ldapsearch -x -b "ou=People,dc=dubuntu,dc=local" -h xxx.xxx.xxx.xxx)

Infos about the LDAP Server (Ubuntu) VM:

baseDN: dc=tubs,dc=ibr,dc=android

organizationalUnit structure:
ou=people,dc=tubs,dc=ibr,dc=android
ou=private_people,ou=people,dc=tubs,dc=ibr,dc=android
ou=public_people,ou=people,dc=tubs,dc=ibr,dc=android

Enjoy the guide!

Clone this wiki locally