加入收藏 | 设为首页 | 会员中心 | 我要投稿 李大同 (https://www.lidatong.com.cn/)- 科技、建站、经验、云计算、5G、大数据,站长网!
当前位置: 首页 > 综合聚焦 > 服务器 > 安全 > 正文

从OpenLDAP检索操作属性

发布时间:2020-12-15 18:35:20 所属栏目:安全 来源:网络整理
导读:我一直在努力寻找一些关于如何从OpenLDAP检索操作属性的好文档. 我想通过LDAP搜索来检索LDAP服务器的基本专有名称. 当我明确要求namingContexts属性时,为什么我的搜索不起作用?我被告知我需要在属性列表中添加加号(”). 如果是这种情况,我应该摆脱“namingC
我一直在努力寻找一些关于如何从OpenLDAP检索操作属性的好文档.

我想通过LDAP搜索来检索LDAP服务器的基本专有名称.

当我明确要求namingContexts属性时,为什么我的搜索不起作用?我被告知我需要在属性列表中添加加号(”).

如果是这种情况,我应该摆脱“namingContexts”属性还是两者都有?

ldapsearch -H ldap://ldap.mydomain.com -x -s base -b "" +
# note the + returns operational attributes

编辑:注意请求的属性看起来是空的.加号不应该在属性列表中吗? http://www.zytrax.com/books/ldap/ch3/#operational

参考:plus sign operator with OpenLDAP

How come my search doesn’t work when I explicitly ask for namingContexts attribute?

什么不起作用?你收到错误了吗?

如果有加号,它将返回所有属性,无论是否添加了namingContexts.

使用:

ldapsearch -x -H ldap://ldap.example.com -s base -b "" namingContexts

返回:

# extended LDIF
#
# LDAPv3
# base <> with scope baSEObject
# filter: (objectclass=*)
# requesting: namingContexts 
#

#
dn:
namingContexts: o=example.com

# search result
search: 2
result: 0 Success

# numResponses: 2
# numEntries: 1

它还列出使用:

ldapsearch -x -H ldap://ldap.example.com -s base -b "" +

返回:

# extended LDIF
#
# LDAPv3
# base <> with scope baSEObject
# filter: (objectclass=*)
# requesting: + 
#

#
dn:
structuralObjectClass: OpenLDAProotDSE
namingContexts: o=example.com
supportedControl: 2.16.840.1.113730.3.4.18
supportedControl: 2.16.840.1.113730.3.4.2
supportedControl: 1.3.6.1.4.1.4203.1.10.1
supportedControl: 1.2.840.113556.1.4.1413
supportedControl: 1.2.840.113556.1.4.1339
supportedControl: 1.2.840.113556.1.4.319
supportedControl: 1.2.826.0.1.334810.2.3
supportedExtension: 1.3.6.1.4.1.1466.20037
supportedExtension: 1.3.6.1.4.1.4203.1.11.1
supportedExtension: 1.3.6.1.4.1.4203.1.11.3
supportedFeatures: 1.3.6.1.4.1.4203.1.5.1
supportedFeatures: 1.3.6.1.4.1.4203.1.5.2
supportedFeatures: 1.3.6.1.4.1.4203.1.5.3
supportedFeatures: 1.3.6.1.4.1.4203.1.5.4
supportedFeatures: 1.3.6.1.4.1.4203.1.5.5
supportedLDAPVersion: 2
supportedLDAPVersion: 3
supportedSASLMechanisms: DIGEST-MD5
supportedSASLMechanisms: CRAM-MD5
subschemaSubentry: cn=Subschema

# search result
search: 2
result: 0 Success

# numResponses: 2
# numEntries: 1

(编辑:李大同)

【声明】本站内容均来自网络,其相关言论仅代表作者个人观点,不代表本站立场。若无意侵犯到您的权利,请及时与联系站长删除相关内容!

    推荐文章
      热点阅读