I am trying to configure openldap on OEL 5.7 and I am getting this error:
ldapadd -a -X -w -D 'cn=ldapadmin,dc=oraia,dc=com' -f initialize_ldap.ldif
ldap_bind: DSA is unwilling to perform ldap_bind: additional info: unauthenticated bind (DN with no password) disallowed
Here is my .ldif file
dn: dc=oraia,dc=com
objectclass: dcObject
objectclass: organization
o: Oraia LDAP Server for Net Service Names
dc: oraia
dn: cn=ldapadmin,dc=oraia,dc=com
objectclass: organizationalRole
cn: ldapadmin
And here is my slapd.conf file
# See slapd.conf(5) for details on configuration options.
# This file should NOT be world readable.
#
include /etc/openldap/schema/core.schema
include /etc/openldap/schema/cosine.schema
include /etc/openldap/schema/inetorgperson.schema
include /etc/openldap/schema/nis.schema
pidfile /var/run/openldap/slapd.pid
argsfile /var/run/openldap/slapd.args
database bdb
suffix "dc=oraia,dc=com"
rootdn "cn=ldapadmin,dc=oraia,dc=com"
# Cleartext passwords, especially for the rootdn, should
# be avoided. See slappasswd(8) and slapd.conf(5) for details.
# Use of strong authentication encouraged.
rootpw secret
# rootpw {crypt}ijFYNcSNctBYg
#rootpw {SSHA}rW/GYmrcz6/CZfp7vMW4Kp+wYWK9rrIk
#rootpw {CRYPT}ld1saKGO4zPbQ
directory /var/lib/ldap
# Indices to maintain for this database
index objectClass eq,pres
index ou,cn,mail,surname,givenname eq,pres,sub
index uidNumber,gidNumber,loginShell eq,pres
index uid,memberUid eq,pres,sub
index nisMapName,nisMapEntry eq,pres,sub
I have tried all the rootpw solutions on internet but it didn't work throw with same error as mentioned.
Try
ldapadd -a -x -w secret -D 'cn=ldapadmin,dc=oraia,dc=com' -f initialize_ldap.ldif
.-X
needs an option that you don't want, and you need to provide the password to-w
. Note thatsecret
comes from your slapd.conf; if you changed it while posting use the real one.