当试图做ldapadd得到这个错误ldap_add:没有这样的对象(32)

我有我的slapd.conf中的以下条目

####################################################################### # ldbm and/or bdb database definitions ####################################################################### #backend hdb database bdb suffix "dc=example,dc=com" checkpoint 1024 15 rootdn "cn=Manager,dc=example,dc=com" rootpw {SSHA}xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx directory /var/lib/ldap index objectClass eq,pres ###################################################################### database monitor access to * by dn.exact="gidNumber=0+uidNumber=0,cn=peercred,cn=external,cn=auth" read by dn.exact="cn=Manager,dc=example,dc=com" read by * none 

当我尝试写下面的命令

 ldapadd -x -W -D "cn=Manager,dc=example,dc=com" -f ldapuser100.ldif 

我有以下错误:

 adding new entry "uid=ldapuser100,ou=People,dc=example,dc=com" ldap_add: No such object (32) 

以下是debugging:

 oc_check_allowed type "structuralObjectClass" bdb_dn2entry("uid=ldapuser100,ou=people,dc=example,dc=com") => bdb_dn2id("dc=example,dc=com") <= bdb_dn2id: get failed: DB_NOTFOUND: No matching key/data pair found (-30988) bdb_add: parent does not exist send_ldap_result: conn=1 op=1 p=3 send_ldap_response: msgid=2 tag=105 err=32 ber_flush2: 22 bytes to sd 12 conn=1 op=1 RESULT tag=105 err=32 text= connection_get(12): got connid=1 connection_read(12): checking for input on id=1 ber_get_next ber_get_next: tag 0x30 len 5 contents: op tag 0x42, time 1379789891 ber_get_next conn=1 op=2 do_unbind conn=1 op=2 UNBIND connection_close: conn=1 sd=12 conn=1 fd=12 closed 

我的LDIF文件的内容:

 dn: uid=ldapuser100,ou=People,dc=example,dc=com uid: ldapuser100 cn: ldapuser100 objectClass: account objectClass: posixAccount objectClass: top objectClass: shadowAccount userPassword: {crypt}xxxxxxxxxxxxxxxxxxxxxxx shadowLastChange: 15969 shadowMin: 0 shadowMax: 99999 shadowWarning: 7 loginShell: /bin/bash uidNumber: 1400 gidNumber: 1400 homeDirectory: /exports/ldapuser100 

我现在应该怎么做?

LDIF文件的内容必须对您的目录敏感。 它看起来(虽然你没有发布在ldif文件中,所以我真的不知道你在做什么),就好像你试图在ou=People,dc=example,dc=com ,但ou =人不存在,或者你的目录的基本DN不知何故不存在。 尝试将人员OU添加到您的基地,并再次添加此LDIF。

另外,一般来说,将你的密码散列到互联网并不是最好的想法。

偶尔,这个问题也是由于无法打开后端BDB数据库造成的,尽pipe通常会在debugging输出中给出一些指示。

你可能需要先input更多的东西。

像你的基地DN:

 dn: dc=example,dc=com objectClass: top objectClass: dcObject objectClass: organization dc: example o: ExmapleCo 

你可能可以省略objectClass = organization和o = ExampleCo(我真的忘记了)。

另外,你的OU:

 dn: ou=People,dc=example,dc=com objectClass: organizationalUnit ou: People