3

我正在尝试在 OEL 5.7 上配置 openldap,但出现此错误:

ldapadd -a -X -w -D 'cn=ldapadmin,dc=oraia,dc=com' -f initialize_ldap.ldif

ldap_bind:DSA 不愿意执行 ldap_bind:附加信息:未经身份验证的绑定(DN 没有密码)不允许

这是我的 .ldif 文件

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

这是我的 slapd.conf 文件

# 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

我已经在互联网上尝试了所有的 rootpw 解决方案,但它没有工作并抛出与提到的相同的错误。

4

1 回答 1

2

试试ldapadd -a -x -w secret -D 'cn=ldapadmin,dc=oraia,dc=com' -f initialize_ldap.ldif-X需要一个您不想要的选项,并且您需要提供-w. 请注意,secret来自您的 slapd.conf;如果您在发布时更改了它,请使用真实的。

于 2013-12-25T21:17:26.150 回答