Take the 2-minute tour ×
Server Fault is a question and answer site for system and network administrators. It's 100% free, no registration required.

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.

  1. 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 
    
  2. 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  ]
    
  3. 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 
    
  4. 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 
    
  5. 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 
    
  6. 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]# 
    
  7. 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.

enter image description here

share|improve this question

1 Answer 1

To manage the objects in your dyrectory, you can use different tools, my preferred one is LAM (Ldap Account Manager). You can get it for free at https://www.ldap-account-manager.org/lamcms/ It integrates the classic tree view from phpMyLdapAdmin, and the more powerfull predefined views, for users, groups, computers and domains. Whit this tool you can easily add users and groups to your directory in a comfortable web environment.

share|improve this answer

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.