0

Information:
I installed ldap-utils and slapd, during installation of slapd, with ncurses dialog, I imported password of administrator.
Then I changed it via

ldapmodify -Q -Y EXTERNAL -H ldapi:/// << E0F
dn: olcDatabase={1}mdb,cn=config
changetype: modify
replace: olcRootPW
olcRootPW: {SSHA}qUoTRPwppaedqHQTgYOPYWokr3SiXjbK
E0F

But with ldapadd -x -D "cn=admin,dc=example,dc=com" -W -f ./users.ldif I get the following messages:

Enter LDAP Password: 
ldap_bind: Invalid credentials (49)

By the way, I don't have slapd.conf.
How can I authenticate via ldap programs?

UPDATE:

root@debian:~# cat /etc/ldap/slapd.d/cn\=config/olcDatabase\=\{1\}mdb.ldif 
# AUTO-GENERATED FILE - DO NOT EDIT!! Use ldapmodify.
# CRC32 73bfb3a8
dn: olcDatabase={1}mdb
objectClass: olcDatabaseConfig
objectClass: olcMdbConfig
olcDatabase: {1}mdb
olcDbDirectory: /var/lib/ldap
olcSuffix: dc=nodomain
olcAccess: {0}to attrs=userPassword by self write by anonymous auth by * none
olcAccess: {1}to attrs=shadowLastChange by self write by * read
olcAccess: {2}to * by * read
olcLastMod: TRUE
olcRootDN: cn=admin,dc=nodomain
olcDbCheckpoint: 512 30
olcDbIndex: objectClass eq
olcDbIndex: cn,uid eq
olcDbIndex: uidNumber,gidNumber eq
olcDbIndex: member,memberUid eq
olcDbMaxSize: 1073741824
structuralObjectClass: olcMdbConfig
entryUUID: 10bd0d0a-82d1-103f-92a4-058be6d2a441
creatorsName: cn=admin,cn=config
createTimestamp: 20250219054944Z
olcRootPW:: MTIzMTIzMTIz
entryCSN: 20250219060430.002303Z#000000#000#000000
modifiersName: gidNumber=0+uidNumber=0,cn=peercred,cn=external,cn=auth
modifyTimestamp: 20250219060430Z
3
  • 1
    1) How did you generate the new olcRootPw value? 2) Does the olcDatabase={1}mdb,cn=config entry have an olcRootDN attribute? 3) Does your main database have a cn=admin,dc=example,dc=com entry? Commented Feb 19 at 8:13
  • 1) via slappasswd . 2) It has, but the value cn=admin,dc=nodomain . 3) I updated post to put my mdb file. Commented Feb 19 at 15:13
  • thank you, I used ldapadd -x -D "cn=admin,dc=nodomain" -W -f ./users.ldif and with new dn my problem was solved. Commented Feb 20 at 11:02

1 Answer 1

0

You have to specify the correct DN to authenticate to the LDAP server, in this case, you had to change dc=example,dc=com to dc=nodomain.

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.