【问题标题】:adding custom attributes to openldap向 openldap 添加自定义属性
【发布时间】:2014-03-17 04:59:09
【问题描述】:

这是我第一次参加 LDAP。我已经在 ubuntu 机器上设置了一个 openldap,在远程系统上设置了一个 ldap 浏览器(phpldapadmin)。我正在尝试向 cn=config 添加两个自定义属性,我收到一条成功的消息,但是如果我看到属性或架构在ldap 浏览器在哪里看不到,请告诉我哪里出错了。以下是我采取的步骤

1)创建custom.schema文件

#file to add custom schemas to the ldap

attributetype ( 1.7.11.1.1
        NAME 'studentid'
        DESC 'unique id given to each student of the college'
        EQUALITY caseIgnoreMatch
        SUBSTR caseIgnoreSubstringsMatch
        SYNTAX 1.3.6.1.4.1.1466.115.121.1.15
        SINGLE-VALUE )

attributetype ( 1.7.11.1.2
        NAME 'pexpiry'
        DESC 'indicated the date of password expiry'
        EQUALITY caseIgnoreMatch
        SUBSTR caseIgnoreSubstringsMatch
        SYNTAX 1.3.6.1.4.1.1466.115.121.1.15
        SINGLE-VALUE )


objectClass ( 1.7.11.1.1.100
    NAME 'Studentinfo'
        DESC 'Studentinfo object classes '
    SUP top
    AUXILIARY
        MUST  ( studentid $ pexpiry $
             )
        )

2)创建一个ldif文件

#ldif file containing the custom schema

dn: cn=custom,cn=schema,cn=config
objectClass: olcSchemaConfig
cn: custom

olcAttributeTypes: ( 1.7.11.1.1
        NAME 'studentid'
        DESC 'unique id given to each student of the college'
        EQUALITY caseIgnoreMatch
        SUBSTR caseIgnoreSubstringsMatch
        SYNTAX 1.3.6.1.4.1.1466.115.121.1.15
        SINGLE-VALUE )

olcAttributeTypes: ( 1.7.11.1.2
        NAME 'pexpiry'
        DESC 'indicated the date of password expiry'
        EQUALITY caseIgnoreMatch
        SUBSTR caseIgnoreSubstringsMatch
        SYNTAX 1.3.6.1.4.1.1466.115.121.1.15
        SINGLE-VALUE )


olcObjectClasses: ( 1.7.11.1.1.100
    NAME 'Studentinfo'
        DESC 'Studentinfo object class '
    SUP top
    AUXILIARY
        MUST  ( studentid $ pexpiry $
             )
        )

3) 使用以下命令将 ldif 文件添加到 cn=config

ldapadd -x -h 192.168.2.3 -D "cn=admin,cn=config" -W -f ./custom.ldif

它首先要求输入密码,我输入密码并收到消息

Adding entry  "cn=custom,cn=schema,cn=config"

但是当我转到浏览器时,我看不到架构或属性。我试图添加一个用户,它说属性无效。

【问题讨论】:

  • 您解决了这个问题吗?我在 389-DS ldap 服务器上遇到了类似的问题。我在前端和通过 ldif 文件创建了一个自定义属性。当我查看属性时,我可以看到该属性,但是如果我尝试使用 ldapmodify 将其添加到 ldif 文件中的用户,它会抱怨该属性无效。我将它添加到 cn=schema 所以想知道是否可能是该属性实际上并未添加到架构中
  • 您是否在 slapd.conf 中添加了自定义架构?

标签: openldap


【解决方案1】:

1] 在 slapd.conf 中添加自定义模式并重新启动 LDAP 服务。如果一切正常,服务将正常启动,否则会出错。 2]在此之后,如果可能的话,使用 Apache Studio 进行浏览,我也无法在其他浏览器中看到自定义对象。

【讨论】:

    猜你喜欢
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2015-03-09
    • 2018-08-06
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    相关资源
    最近更新 更多