Linux 如何在ldap(Ubuntu)中获取根dn

Linux 如何在ldap(Ubuntu)中获取根dn,linux,ldap,Linux,Ldap,我想知道ldap中的根dn,有命令吗? 下面是我在/etc/ldap/slapd.d/cn\=config.ldif中找到的内容 dn: cn=config objectClass: olcGlobal cn: config olcArgsFile: /var/run/slapd/slapd.args olcLogLevel: none olcPidFile: /var/run/slapd/slapd.pid olcToolThreads: 1 structuralObjectClass: ol

我想知道ldap中的根dn,有命令吗? 下面是我在/etc/ldap/slapd.d/cn\=config.ldif中找到的内容

dn: cn=config
objectClass: olcGlobal
cn: config
olcArgsFile: /var/run/slapd/slapd.args
olcLogLevel: none
olcPidFile: /var/run/slapd/slapd.pid
olcToolThreads: 1
structuralObjectClass: olcGlobal
entryUUID: 6a0e29d2-7341-1036-810b-5902d64537f7
creatorsName: cn=config
createTimestamp: 20170120094900Z
entryCSN: 20170120094900.675648Z#000000#000#000000
modifiersName: cn=config
modifyTimestamp: 20170120094900Z

这是否意味着根dn为'cn=config'?

许多服务器将这些参数公开为属性

您正在查找NamingContext属性。(某些服务器还具有defaultNamingContext和/或configContext。)

您必须使用“base”作为搜索范围

这些是操作属性,必须通过名称或+通配符显式请求

ldapsearch -LLL -h <ldaphost> -b "" -s base +

许多服务器将这些参数公开为属性

您正在查找NamingContext属性。(某些服务器还具有defaultNamingContext和/或configContext。)

您必须使用“base”作为搜索范围

这些是操作属性,必须通过名称或+通配符显式请求

ldapsearch -LLL -h <ldaphost> -b "" -s base +
dn:
structuralObjectClass: OpenLDAProotDSE
configContext: cn=config
namingContexts: dc=mydomain
namingContexts: dc=mydomain2,dc=myorg
supportedControl: 2.16.840.1.113730.3.4.9
supportedControl: 1.2.840.113556.1.4.473
supportedControl: 1.3.6.1.4.1.4203.1.9.1.1
.
.
.
supportedExtension: 1.3.6.1.4.1.1466.20037
supportedExtension: 1.3.6.1.4.1.4203.1.11.1
.
.
supportedFeatures: 1.3.6.1.1.14
supportedFeatures: 1.3.6.1.4.1.4203.1.5.1
.
.
supportedLDAPVersion: 3
supportedSASLMechanisms: LOGIN
supportedSASLMechanisms: PLAIN
entryDN:
subschemaSubentry: cn=Subschema