AskOverflow.Dev

AskOverflow.Dev Logo AskOverflow.Dev Logo

AskOverflow.Dev Navigation

  • 主页
  • 系统&网络
  • Ubuntu
  • Unix
  • DBA
  • Computer
  • Coding
  • LangChain

Mobile menu

Close
  • 主页
  • 系统&网络
    • 最新
    • 热门
    • 标签
  • Ubuntu
    • 最新
    • 热门
    • 标签
  • Unix
    • 最新
    • 标签
  • DBA
    • 最新
    • 标签
  • Computer
    • 最新
    • 标签
  • Coding
    • 最新
    • 标签
主页 / server / 问题 / 540721
Accepted
Pradeep Gupta
Pradeep Gupta
Asked: 2013-09-22 11:00:52 +0800 CST2013-09-22 11:00:52 +0800 CST 2013-09-22 11:00:52 +0800 CST

当试图做 ldapadd 得到这个错误 ldap_add: No such object (32)

  • 772

我的 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)

以下是调试:

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

我现在该怎么办?

openldap
  • 1 1 个回答
  • 18235 Views

1 个回答

  • Voted
  1. Best Answer
    Falcon Momot
    2013-09-22T11:23:07+08:002013-09-22T11:23:07+08:00

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

    此外,一般来说,将您的密码哈希发布到 Internet 并不是最好的主意。

    有时,此问题也是无法打开后端 BDB 数据库的结果,但通常会在调试输出中给出一些指示。

    不过,您可能需要先导入更多内容。

    就像你的基础 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
    
    • 7

相关问题

  • OpenLDAP 无效凭证

  • 从 OpenLDAP 检索操作属性

  • 为 Mac 网络使用 Linux 和 Open LDAP

  • 使用LDAP服务器身份验证的Linux中单个用户的多个登录名

  • 将 OpenLDAP 实现为目录而不是控制网络访问的指南?[关闭]

Sidebar

Stats

  • 问题 205573
  • 回答 270741
  • 最佳答案 135370
  • 用户 68524
  • 热门
  • 回答
  • Marko Smith

    新安装后 postgres 的默认超级用户用户名/密码是什么?

    • 5 个回答
  • Marko Smith

    SFTP 使用什么端口?

    • 6 个回答
  • Marko Smith

    命令行列出 Windows Active Directory 组中的用户?

    • 9 个回答
  • Marko Smith

    什么是 Pem 文件,它与其他 OpenSSL 生成的密钥文件格式有何不同?

    • 3 个回答
  • Marko Smith

    如何确定bash变量是否为空?

    • 15 个回答
  • Martin Hope
    Tom Feiner 如何按大小对 du -h 输出进行排序 2009-02-26 05:42:42 +0800 CST
  • Martin Hope
    Noah Goodrich 什么是 Pem 文件,它与其他 OpenSSL 生成的密钥文件格式有何不同? 2009-05-19 18:24:42 +0800 CST
  • Martin Hope
    Brent 如何确定bash变量是否为空? 2009-05-13 09:54:48 +0800 CST
  • Martin Hope
    cletus 您如何找到在 Windows 中打开文件的进程? 2009-05-01 16:47:16 +0800 CST

热门标签

linux nginx windows networking ubuntu domain-name-system amazon-web-services active-directory apache-2.4 ssh

Explore

  • 主页
  • 问题
    • 最新
    • 热门
  • 标签
  • 帮助

Footer

AskOverflow.Dev

关于我们

  • 关于我们
  • 联系我们

Legal Stuff

  • Privacy Policy

Language

  • Pt
  • Server
  • Unix

© 2023 AskOverflow.DEV All Rights Reserve