Take the 2-minute tour ×
Server Fault is a question and answer site for system and network administrators. It's 100% free, no registration required.

I am setting up OpenLDAP for the first time, on RHEL6 and using Puppet to do the initial install/configuration.

I believe the configuration uses the slapd.d rather than slapd.conf method.

Basically, I believe Puppet has successfully created a Database which I want to use as the root of my configuration tree. This is the output of slapcat that shows this database created:

dn: olcDatabase={3}hdb,cn=config
objectClass: olcDatabaseConfig
objectClass: olcHdbConfig
olcDatabase: {3}hdb
olcDbDirectory: /var/lib/ldap/
olcSuffix: dc=corp.f7
olcRootDN: cn=root,dc=corp.f7
structuralObjectClass: olcHdbConfig
entryUUID: 8fce2bda-78b8-1033-80d2-f79b693c6963
creatorsName: gidNumber=0+uidNumber=0,cn=peercred,cn=external,cn=auth
createTimestamp: 20140526002936Z
olcAccess: {0}to * by * read
olcRootPW:: e1NTSEF9MGkzazlZdldwMVNpU1FNVjhnNDQ4MHJBNFUra0FUdTI=
entryCSN: 20140526010102.566286Z#000000#000#000000
modifiersName: gidNumber=0+uidNumber=0,cn=peercred,cn=external,cn=auth
modifyTimestamp: 20140526010102Z

Then following an example I found online, I am trying to feed the following ldif file into this command:

ldapadd -cxWD cn=root,dc=corp.f7 -W -f /tmp/static.ldif

# User account
dn: uid=jsmith,dc=corp.f7
cn: John Smith
givenName: John
sn: Smith
uid: jsmith
uidNumber: 10000
gidNumber: 10000
homeDirectory: /home/jsmith
mail: jsmith@dev.local
objectClass: top
objectClass: posixAccount
objectClass: shadowAccount
objectClass: inetOrgPerson
objectClass: organizationalPerson
objectClass: person
loginShell: /bin/bash
userPassword: {CRYPT}*

However, I simply get the following error output:

adding new entry "uid=jsmith,dc=corp.f7"
ldap_add: No such object (32)

I am not really sure what object it can't find...is it the dc=corp.f7?

How do I go about setting up groups and users in this database I created?


share|improve this question
what does ldapsearch -x print out? –  Daywalker May 26 '14 at 5:04
@Daywalker # search result search: 2 result: 32 No such object # numResponses: 1 –  aaa90210 May 26 '14 at 5:54
It seems like your initial config is wrong. dc=corp.f7 seems not a correct name for OpenLDAP. (but i never tried). I would have used something like dc=corp,dc=f7 and just start over with the setup. (and you got two Warguments in your ldapadd command, maybee a problem?) btw.: the FreeBSD Handbook helped me a lot with the understanding of OpenLDAP (i got both, a Debian and a FreeBSD OpenLDAP Server) –  Daywalker May 26 '14 at 10:08
@Daywalker OK thanks I'll give it a try. –  aaa90210 May 26 '14 at 10:23
@Daywalker I've now tried several RDN combinations, but none of them work. Running SLAPD manually, I see this error when I try and do ldapsearch: "hdb_dn2id: get failed: DB_NOTFOUND: No matching key/data pair found". Not sure what's going on. –  aaa90210 May 27 '14 at 1:25

1 Answer 1

First, you need a parent object for your user, second, you can't use the dot in the dcObject, dc (domain component) takes only alphanumerics and hyphen (see RFC4519)

dn: dc=corp,dc=f7
objectClass: dcObject
objectClass: organization
dc: corp
o: corp

(And you can't use dcObject as the only object class because it's defined as auxilliary, so you need a structural class to provide some scaffolding; organization will do nicely. You might want to read RFC4519 while you're at it :-))

share|improve this answer

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.