没有发生此类对象 (32) 错误:ldapsearch -x -LLL -H ldap://IP -D "cn=admin,dc=mynewdomain,dc=com" -W -b cn=config "(objectClass =*)”

问题描述 投票:0回答:1

我已经配置了OpenLdap服务器和客户端,连接成功,因为我创建了一个用户并在ubuntu桌面上登录了该用户帐户。但是当我输入如下命令时:

ldapsearch -x -LLL -H ldap://mynewdomain.com -D "cn=admin,dc=mynewdomain,dc=com" -W -b cn=config "(objectClass=olcDatabaseConfig)"

停顿一段时间后,输出:

ldap_sasl_bind(SIMPLE): Can't contact LDAP server (-1)

其实,配置完OpenLdap后,我想制作ACL用于测试目的:

命令:

sudo ldapmodify -Y EXTERNAL -H ldapi:/// <<EOF
dn: olcDatabase={1}mdb,cn=config  # Replace {X} with the appropriate number for your database
changetype: modify
replace: olcAccess
olcAccess: {1}to dn.base="" by * read
EOF

输出:

SASL/EXTERNAL authentication started
SASL username: gidNumber=0+uidNumber=0,cn=peercred,cn=external,cn=auth
SASL SSF: 0
modifying entry "olcDatabase={1}mdb,cn=config  # Replace {X} with the appropriate number for your database"
ldap_modify: Server is unwilling to perform (53)
        additional info: no global superior knowledge

我只是想知道如何编写和实现ACL,但是出现了这个错误 然后我用谷歌搜索了一下,它与上面给出的问题有关。 请帮助我,我很困难

ldap acl openldap
1个回答
0
投票

停顿一段时间后,输出:

ldap_sasl_bind(SIMPLE): Can't contact LDAP server (-1)

延迟或超时听起来像是您的防火墙阻止了与 LDAP 服务的连接。

您可以通过添加

ldap*
使
-d <level>
命令更加详细,例如
ldapsearch -d 7
。 (这对于揭示例如与 TLS 证书相关的错误消息很有用。)不过,在这种情况下,看起来该服务确实没有在端口 389 上进行应答。

modifying entry "olcDatabase={1}mdb,cn=config  # Replace {X} with the appropriate number for your database"
ldap_modify: Server is unwilling to perform (53)
        additional info: no global superior knowledge

您忘记从 LDIF 文件中删除

# comment
。 (LDIF 不支持“内联”注释;仅识别全行注释,并且编写教程的人应该使用全行注释。)因此,由于注释仍然存在,LDAP 服务器认为您正在尝试编辑
cn=config # Replace the X
下的条目,而不是预期的
cn=config

“没有全局优越知识”基本上意味着“我没有这个 DN 的匹配数据库”。 (错误消息的措辞实际上意味着“...而且我也无法将您向上重定向到另一台服务器”,因为它是 20 世纪 80 年代 X.500 的遗物,它想象所有目录都会互连,但您可以忽略所有这些并将其视为“此 DN 没有匹配的数据库”错误消息。)

© www.soinside.com 2019 - 2024. All rights reserved.