ubuntu 12.10 openldap问题DN语法无效(34)“

我以下: https : //help.ubuntu.com/12.10/serverguide/openldap-server.html当我到达的部分说

ldapsearch -x -LLL -H ldap:/// -b dc = example,dc = com dn

我得到:

Invalid DN syntax (34) Additional information: invalid DN 

我注意到:

 sudo ldapsearch -Q -LLL -Y EXTERNAL -H ldapi:/// -b cn=config dn dn: cn=config dn: cn=schema,cn=config dn: olcDatabase={-1}frontend,cn=config dn: olcDatabase={0}config,cn=config 

谢谢你的帮助

您没有定义架构。 为了执行您的示例search,您需要一个接近core.schema的以下定义的模式。

 olcAttributeTypes: ( 0.9.2342.19200300.100.1.25 NAME ( 'dc' 'domainComponent' ) DESC 'RFC1274/2247: domain component' EQUALITY caseIgnoreIA5Match SUBSTR caseIgnoreIA5SubstringsMatch SYNTAX 1.3.6.1.4.1.1466.115.121.1.26 SINGLE-VALUE ) olcObjectClasses: ( 1.3.6.1.4.1.1466.344 NAME 'dcObject' DESC 'RFC2247: domain component object' SUP top AUXILIARY MUST dc ) 

实际上,你可能只需要添加core.schema到你的slapd ,ubuntu-12.10使用slapd-config ,那么你实际上会添加一个.ldif文件。

sudo ldapadd -Q -Y EXTERNAL -H ldapi:/// -f /etc/ldap/schema/core.ldif

根据你在做什么,你可能也想要:

  • cosine (需要inetorgperson)
  • inetorgperson
  • nis (我推荐rfc2307bis ,但你必须从其他地方拿走)
  • misc (邮件路由)