I am using Centos 5.3 to configure my openldap server. Everything is going ok. The problem which I am facing is how to add users and groups in my ldap server.
My slapd.conf is
# vi /etc/openldap/slapd.conf database bdb suffix "dc=test,dc=local" rootdn "cn=Manager,dc=test,dc=local" rootpw 123
Now I start my LDAP service
[root@srv1 openldap]# service ldap start Checking configuration files for slapd: bdb_db_open: Warning - No DB_CONFIG file found in directory /var/lib/ldap: (2) Expect poor performance for suffix dc=test,dc=local. config file testing succeeded [ OK ] Starting slapd: [ OK ]
Now I perform search
[root@srv1 openldap]# ldapsearch -x -b "dc=test,dc=local" "(objectclass=*)" # extended LDIF # # LDAPv3 # base <dc=test,dc=local> with scope subtree # filter: (objectclass=*) # requesting: ALL # # search result search: 2 result: 32 No such object # numResponses: 1
I create a ldif file inside /etc/openldap folder
[root@srv1 openldap]# vim base.ldif # base.ldif # Build the root node dn: dc=test,dc=local dc: test objectClass: top objectClass: domain
Now I create add two OUs
[root@srv1 openldap]# vim Add_2_OUs.ldif # To add two OUs i.e Sales and Marketing dn: ou=Sales,dc=test,dc=local ou: Sales objectClass:organizationalUnit dn: ou=Marketing,dc=test,dc=local ou: Marketing objectClass: organizationalUnit
Now add the OUs
[root@srv1 openldap]# ldapadd -D "cn=Manager,dc=test,dc=local" -W -x -f Add_2_OUs.ldif Enter LDAP Password: adding new entry "ou=Sales,dc=test,dc=local" adding new entry "ou=Marketing,dc=test,dc=local" [root@srv1 openldap]#
Now I perform search
[root@srv1 openldap]# ldapsearch -x -b "dc=test,dc=local" "(objectclass=*)" # extended LDIF # # LDAPv3 # base <dc=test,dc=local> with scope subtree # filter: (objectclass=*) # requesting: ALL # # test.local dn: dc=test,dc=local dc: test objectClass: top objectClass: domain # Sales, test.local dn: ou=Sales,dc=test,dc=local ou: Sales objectClass: organizationalUnit # Marketing, test.local dn: ou=Marketing,dc=test,dc=local ou: Marketing objectClass: organizationalUnit # search result search: 2 result: 0 Success # numResponses: 4 # numEntries: 3 [root@srv1 openldap]#
If you think that there is some technical or logical mistake please guide me so I may improve it more.
Also please guide me that How can I add groups and users in my ldap server ? I am also adding DIT (Directory Information Tree) diagram for your easiness.