I'm trying to get started with OpenLDAP and I'm following this guide https://www.itzgeek.com/how-tos/linux/centos-how-tos/step-step-openldap-server-configuration-centos-7-rhel-7.html

I've done all the steps from a fresh CentOS7 installation. I have copy-pasted all commands and have not changed anything. Everything goes well until I want to add a user at page 2 in the guide. The guide tells me to use this command after editing the file raj.ldif:

ldapadd -x -W -D "cn=ldapadm,dc=itzgeek,dc=local" -f raj.ldif

The expected output is:

Enter LDAP Password: 
adding new entry "uid=raj,ou=People,dc=itzgeek,dc=local"

But the actual output is:

Enter LDAP Password: 

I tried entering another password. I also tried using a file that does not exists. Both these yields an error message, so it cannot be any of those. I'm at a loss here. What am I doing wrong?

  • It may be helpful to see the file raj.ldif (with sensitive information removed). Also, maybe the dn already exists and the verb is to add instead of replace. Check with slapcat what's going on in the database. – rexkogitans Jun 25 at 11:53

I redid the whole procedure with three changes:

  1. Changed hostname to server.itzgeek.local (Same as they used in the tutorial)
  2. Turned off firewall with systemctl stop firewalld
  3. Turned off SELinux with setenforce 0

I'm not sure which of these things that did it, but I do believe it is the hostname that was the issue.


It looks like slapd believes you omitted any dn in your ldif.

E.g. if you attempted to add an ldif file with this content you could experience the same results:

n: uid=raj,ou=People,dc=itzgeek,dc=local
objectClass: top
objectClass: account
objectClass: posixAccount
objectClass: shadowAccount
cn: raj
uid: raj
uidNumber: 9999
gidNumber: 100
homeDirectory: /home/raj
loginShell: /bin/bash
gecos: Raj [Admin (at) ITzGeek]
userPassword: {crypt}x
shadowLastChange: 17058
shadowMin: 0
shadowMax: 99999
shadowWarning: 7
  • Do you mean that I may have missed the first character when copy pasting? – klutt Jun 25 at 16:25
  • Could have also missed the first n lines. – 84104 Jun 26 at 1:21
  • Possibly. Unfortunately, I cannot check if that was the issue, since I have deleted the first virtual machine I used. – klutt Jun 26 at 4:15

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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