0

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?

1
  • 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. Commented Jun 25, 2019 at 11:53

2 Answers 2

0

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.

0

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 
3
  • Do you mean that I may have missed the first character when copy pasting? Commented Jun 25, 2019 at 16:25
  • Could have also missed the first n lines. Commented Jun 26, 2019 at 1:21
  • Possibly. Unfortunately, I cannot check if that was the issue, since I have deleted the first virtual machine I used. Commented Jun 26, 2019 at 4:15

You must log in to answer this question.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.