create ldif file and add these attribute and include into ldap db using ldapadd command
you can follow something like this to set up a minimal LDAP DIT (Directory Information Tree).
Open temporary file:
Insert the following. Once again the dn has to be changed to reflect your environment.
Code:
# Tree root
dn: dc=example,dc=com
objectClass: dcObject
objectclass: organization
o: example.com
dc: example
description: Tree root
# LDAP admin
dn: cn=admin,dc=example,dc=com
objectClass: simpleSecurityObject
objectClass: organizationalRole
cn: admin
userPassword: {SSHA}LDeTJEEBhqypKL2FpQuFc2j4Na1TLTRW
description: LDAP administrator
Apply the file:
Code:
# ldapadd -x -D cn=admin,dc=example,dc=com -W -f base.ldif
Validate LDAP DIT: Query your LDAP DIT : this time as anonymous user - hence no password is shown for your cn=admin,dc=example,dc=com):
Code:
# ldapsearch -xLLL -b dc=example,dc=com
Hope it helps. .