我像这样进行ldapsearch时没有任何反应。
> ldapsearch -x -D "uid=joe,ou=people,dc=example,dc=org" -w joe -b "ou=group,dc=example,dc=org" "(objectclass=*)"
# extended LDIF
#
# LDAPv3
# base <ou=group,dc=example,dc=org> with scope subtree
# filter: (objectclass=*)
# requesting: ALL
#
# search result
search: 2
result: 32 No such object
# numResponses: 1
Openldap日志在这里
5c10a31c conn=1029 fd=13 ACCEPT from IP=172.17.0.1:34710 (IP=0.0.0.0:389)
5c10a31c conn=1029 op=0 BIND dn="uid=joe,ou=people,dc=example,dc=org" method=128
5c10a31c conn=1029 op=0 BIND dn="uid=joe,ou=people,dc=example,dc=org" mech=SIMPLE ssf=0
5c10a31c conn=1029 op=0 RESULT tag=97 err=0 text=
5c10a31c conn=1029 op=1 SRCH base="ou=group,dc=example,dc=org" scope=2 deref=0 filter="(objectClass=*)"
5c10a31c conn=1029 op=1 SEARCH RESULT tag=101 err=32 nentries=0 text=
5c10a31c conn=1029 op=2 UNBIND
5c10a31c conn=1029 fd=13 closed
这是用户和组的ldif文件
# People, example.org
dn: ou=people,dc=example,dc=org
ou: people
objectClass: organizationalUnit
# Groups, example.org
dn: ou=group,dc=example,dc=org
ou: group
objectClass: organizationalUnit
dn: uid=joe,ou=people,dc=example,dc=org
objectClass: person
objectClass: inetOrgPerson
uid: joe
cn: Joe Doe
sn: Doe
givenName: Joe
userPassword: joe
description: This is an example user
dn: cn=c3admin,ou=group,dc=example,dc=org
objectClass: groupOfNames
cn: c3admin
member: uid=joe,ou=people,dc=example,dc=org
似乎绑定用户和基本dn的设置不正确。 请给我一个解决此问题的建议。
我将osixia / docker-openldap:1.2.2用于openldap。并在“ cn = admin,dc = example,dc = org”为管理员用户进行了自动设置
docker run -p 389:389 -p 689:689 --name my-openldap-container --detach osixia / openldap:1.2.2
使用成员过滤器进行搜索,然后收到错误消息。
ldapsearch -x -D "uid=joe,ou=people,dc=example,dc=org" -w joe -b "ou=group,dc=example,dc=org" "(member=uid=joe,ou=people,dc=example,dc=org)"
# extended LDIF
#
# LDAPv3
# base <ou=group,dc=example,dc=org> with scope subtree
# filter: (member=uid=joe,ou=people,dc=example,dc=org)
# requesting: ALL
#
# search result
search: 2
result: 32 No such object
# numResponses: 1
使用基本DN进行搜索,然后收到错误消息。
ldapsearch -x -D "uid=joe,ou=people,dc=example,dc=org" -w joe -b "dc=example,dc=org" "(objectclass=*)"
# extended LDIF
#
# LDAPv3
# base <dc=example,dc=org> with scope subtree
# filter: (objectclass=*)
# requesting: ALL
#
# search result
search: 2
result: 32 No such object
# numResponses: 1
使用绑定admin dn进行搜索,然后获得5个条目。 ldapsearch -x -D“ cn = admin,dc = example,dc = org” -w admin -b“ ou = group,dc = example,dc = org”“(objectclass = )” #扩展的LDIF # #LDAPv3 #以作用域子树为基础 #过滤器:(objectclass = ) #要求:全部 #
# group, example.org
dn: ou=group,dc=example,dc=org
ou: group
objectClass: organizationalUnit
# admin, group, example.org
dn: cn=admin,ou=group,dc=example,dc=org
cn: admin
objectClass: groupOfNames
member: uid=john,ou=group,dc=example,dc=org
# john, group, example.org
dn: uid=john,ou=group,dc=example,dc=org
uid: john
givenName: Joe
description: This is an example user
sn: Doe
cn: Joe Doe
objectClass: person
objectClass: inetOrgPerson
userPassword:: am9obg==
# c3admin, group, example.org
dn: cn=c3admin,ou=group,dc=example,dc=org
objectClass: groupOfNames
cn: c3admin
member: uid=joe,ou=people,dc=example,dc=org
# c3viewer, group, example.org
dn: cn=c3viewer,ou=group,dc=example,dc=org
objectClass: groupOfNames
cn: c3viewer
member: uid=tom,ou=people,dc=example,dc=org
# search result
search: 2
result: 0 Success
# numResponses: 6
# numEntries: 5
答案 0 :(得分:0)
您的搜索要求返回条目“ ou = group,dc = example,dc = org”下方的条目“((objectclass = *)”。
我猜没有。
要查找组ou = group,dc = example,dc = org中的成员,请使用类似于以下内容的过滤器: “(成员= *)”
查找所有条目使用: 过滤器:“(objectclass = *)” 基础(-b):“ dc = example,dc = org”
-吉姆