OpenLDAP

From The Incoherency.Net Wiki
Jump to: navigation, search

LDAPworm.png

Create LDIF Export of Directory

slapcat -f /usr/local/etc/openldap/slapd.conf -b "dc=incoherency,dc=net"

Import LDIF

ldapadd -f file.ldif -x -W -D "cn=Manager,dc=incoherency,dc=net"

Base Directory

dn: dc=incoherency,dc=net
dc: incoherency
ou: Incoherency Dot Net
objectClass: dcObject
objectClass: organizationalUnit
objectClass: top
structuralObjectClass: organizationalUnit
dn:ou=groups, dc=incoherency, dc=net
objectclass: top
objectclass: organizationalUnit
ou: groups
structuralObjectClass: organizationalUnit
dn:ou=people, dc=incoherency, dc=net
objectclass: top
objectclass: organizationalUnit
ou: people
structuralObjectClass: organizationalUnit

Sample User LDIF

(No, the hash below isn't my actual password hash)

dn: uid=denis, ou=people, dc=incoherency, dc=net
cn: Denis
sn: Lemire
objectclass: top
objectclass: person
objectclass: posixAccount
objectclass: shadowAccount
uid:denis
userpassword:{SSHA}70l0mVcRrLMK0/NtpEbMzzf00jS6EDZ9
uidnumber:2000
gidnumber:2000
gecos:Denis Lemire
loginShell:/bin/csh
homeDirectory: /home/denis
dn: cn=denis, ou=groups, dc=incoherency, dc=net
objectclass: top
objectclass: posixGroup
cn: denis
gidnumber: 2000

Deleting an Entry

dn: uid=denis,ou=people,dc=incoherency,dc=net
changetype: delete