Take the 2-minute tour ×
Ask Ubuntu is a question and answer site for Ubuntu users and developers. It's 100% free.

I am following the Ubuntu server guide to configure OpenLDAP on an Ubuntu 10.04 server, but can not get it to work.

When I try to use sudo ldapadd -x -D cn=admin,dc=don,dc=com -W -f frontend.ldif I'm getting the following error:

Enter LDAP Password: <entered 'secret' as password>
adding new entry "dc=don,dc=com"
ldap_add: Naming violation (64)
      additional info: value of single-valued naming attribute 'dc' conflicts with value present in entry

Again when I try to do the same, I'm getting the following error:

root@avy-desktop:/home/avy# sudo ldapadd -x -D cn=admin,dc=don,dc=com -W -f frontend.ldif
Enter LDAP Password:
ldap_bind: Invalid credentials (49)

Here is the backend.ldif file:

# Load dynamic backend modules
dn: cn=module,cn=config
objectClass: olcModuleList
cn: module
olcModulepath: /usr/lib/ldap
olcModuleload: back_hdb

# Database settings
dn: olcDatabase=hdb,cn=config
objectClass: olcDatabaseConfig
objectClass: olcHdbConfig
olcDatabase: {1}hdb
olcSuffix: dc=don,dc=com
olcDbDirectory: /var/lib/ldap
olcRootDN: cn=admin,dc=don,dc=com
olcRootPW: secret
olcDbConfig: set_cachesize 0 2097152 0
olcDbConfig: set_lk_max_objects 1500
olcDbConfig: set_lk_max_locks 1500
olcDbConfig: set_lk_max_lockers 1500
olcDbIndex: objectClass eq
olcLastMod: TRUE
olcDbCheckpoint: 512 30
olcAccess: to attrs=userPassword by dn="cn=admin,dc=don,dc=com" write by anonymous auth by self write by * none
olcAccess: to attrs=shadowLastChange by self write by * read
olcAccess: to dn.base="" by * read
olcAccess: to * by dn="cn=admin,dc=don,dc=com" write by * read

frontend.ldif file:

# Create top-level object in domain
dn: dc=don,dc=com
objectClass: top
objectClass: dcObject
objectclass: organization
o: Example Organization
dc: Example
description: LDAP Example 

# Admin user.
dn: cn=admin,dc=don,dc=com
objectClass: simpleSecurityObject
objectClass: organizationalRole
cn: admin
description: LDAP administrator
userPassword: secret

dn: ou=people,dc=don,dc=com
objectClass: organizationalUnit
ou: people

dn: ou=groups,dc=don,dc=com
objectClass: organizationalUnit
ou: groups

dn: uid=john,ou=people,dc=don,dc=com
objectClass: inetOrgPerson
objectClass: posixAccount
objectClass: shadowAccount
uid: john
sn: Doe
givenName: John
cn: John Doe
displayName: John Doe
uidNumber: 1000
gidNumber: 10000
userPassword: password
gecos: John Doe
loginShell: /bin/bash
homeDirectory: /home/john
shadowExpire: -1
shadowFlag: 0
shadowWarning: 7
shadowMin: 8
shadowMax: 999999
shadowLastChange: 10877
mail: john.doe@don.com
postalCode: 31000
l: Toulouse
o: Example
mobile: +33 (0)6 xx xx xx xx
homePhone: +33 (0)5 xx xx xx xx
title: System Administrator
initials: JD

dn: cn=example,ou=groups,dc=don,dc=com
objectClass: posixGroup
cn: example
gidNumber: 10000

Can anyone help me?

share|improve this question
Anybody has any idea? –  user3215 Mar 9 '11 at 7:49
No one uses ldap?. Why even the documents are not working as expected. –  user3215 Mar 9 '11 at 10:04

2 Answers 2

This link helped install LDAP without any error and had to edit only the starting lines 2,3 and 4. Just checked the ldap installation and configuration with webmin

share|improve this answer

For me, your frontend.ldif seems to be invalid, where dn stated dn: dc=don,dc=com (so rdn is dc=don) but still, you use dc: Example later. I think you've tried to use a tutorial, but you forget to modify some parts of your ldif file, if dn is correct, you should use dc: don (the same as in dn). Also you mention backend.ldif (which seems to be modify some settings via config backend of slapd) and frontend.ldif but you only shows example that you try to add entries from frontend.ldif and not backend.ldif.

share|improve this answer
Yes, in the documnet it was dc=example,dc=com so I changed, but here dc: Example which is captical E and I thought it could be any name. I'll try that changing –  user3215 Mar 10 '11 at 2:02
I added backend file and it didn't give any error! –  user3215 Mar 10 '11 at 2:16
Still it gives the same error! –  user3215 Mar 11 '11 at 4:08

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.