向openldap添加自定义属性
这是我第一次使用LDAP。我在ubuntu机器上安装了openldap,在远程系统上安装了ldap浏览器(phpldapadmin)。我正在尝试向cn=config添加两个自定义属性,我收到了一条成功的消息,但是如果我在ldap浏览器中看到属性或模式,它不可见,请告诉我哪里出了问题。以下是我采取的步骤 1) 创建custom.schema文件向openldap添加自定义属性,openldap,Openldap,这是我第一次使用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 N
#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"
但当我转到浏览器时,我看不到架构和属性。我试图添加一个用户,它说属性无效。1]在slapd.conf中添加自定义架构,然后重新启动LDAP服务。如果一切正常,服务将正常启动,否则会出现错误。
2] 在此之后,如果可能,请使用Apache Studio进行浏览,我也无法在其他浏览器中看到自定义对象。您是否解决了此问题。我在389-DS ldap服务器上遇到了类似的问题。我已经在前端和通过ldif文件创建了一个自定义属性。查看属性时可以看到该属性,但如果尝试使用ldapmodify将其添加到ldif文件中的用户,它会抱怨该属性无效。我将它添加到cn=schema,所以我想知道是否该属性实际上没有添加到schemadid中,您是否在slapd.conf中添加自定义模式?