Question

This is my first time at LDAP . I have setup an openldap on ubuntu machine and an ldap browser (phpldapadmin) on the remote system .I 'm trying to add two custom attributes to the cn=config and i get a successful message but if i see the attributes or the schema in the ldap browser its no where visible , please let me know where i'm going wrong . Below are the steps i have taken

1)Creating custom.schema file

#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)Create an ldif file

#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)Add the ldif file to the cn=config using the below command

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

It first asks for password , i enter the password and i get the message as

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

But when i goto browser i don't see the schema nor the attributes there .I tried to add an user it said invalid attributes .

Was it helpful?

Solution

1] Add custom schema in slapd.conf and restart LDAP service.If Everything is ok service will start properly otherwise it will give error. 2] After this if possible use Apache Studio for browsing,i was also not able to see the custom object in other browsers.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top