Need help for adding userss and groups in Openldap server.

Installing, Configuring, Troubleshooting server daemons such as Web and Mail
Post Reply
mypass604
Posts: 21
Joined: 2010/06/06 08:48:12

Need help for adding userss and groups in Openldap server.

Post by mypass604 » 2012/10/23 09:09:17

hi,

I am using Centos 5.3 to configure my openldap server.Every thing is going ok .The problem which I am facing is how to add users and group 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 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 following is my file inside in /etc/openldap/



[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-Using ldapadd command to add 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 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 ?


Thanks,

mypass

User avatar
TrevorH
Site Admin
Posts: 33220
Joined: 2009/09/24 10:40:56
Location: Brighton, UK

Need help for adding userss and groups in Openldap server.

Post by TrevorH » 2012/10/23 09:29:59

I can't comment on the LDAP aspects of your post but please don't use CentOS 5.3. The current release is 5.8 and 5.3 is now nearly 3 years old, has numerous security vulnerabilities and has known bugs which will be fixed by upgrading. You should run `yum update` ASAP after reading the release notes for the intervening releases.

mypass604
Posts: 21
Joined: 2010/06/06 08:48:12

Re: Need help for adding userss and groups in Openldap server.

Post by mypass604 » 2012/10/23 09:55:44

yes I know but at the moment i am doing these in non production enviroment just for my own practice.I think the commands should be same in centos 5.3 and 5.8

Just guide me about howto add users into groups.

thanks

User avatar
TrevorH
Site Admin
Posts: 33220
Joined: 2009/09/24 10:40:56
Location: Brighton, UK

Re: Need help for adding userss and groups in Openldap server.

Post by TrevorH » 2012/10/23 12:13:31

Did you try [b]scottro's[/b] [url=http://home.roadrunner.com/~computertaijutsu/ldap.html]OpenLDAP[/url] pages?

mypass604
Posts: 21
Joined: 2010/06/06 08:48:12

Re: Need help for adding userss and groups in Openldap server.

Post by mypass604 » 2012/10/23 15:06:52

thanks for the link. Well i am doing thing just for my own practice. Do you suggest that I use CentOS 5.5 and above. Actually I want to use the old method.In my new version of CentOS 6.3 there is no concept of slapd.conf file.

But I want to stick with the old method. Just guide me that is there any mistake or any logical thing which you think that it should add in my configuration ?


thanks,

mypass

User avatar
TrevorH
Site Admin
Posts: 33220
Joined: 2009/09/24 10:40:56
Location: Brighton, UK

Re: Need help for adding userss and groups in Openldap server.

Post by TrevorH » 2012/10/23 16:32:08

It's been about 3 years since I last used LDAP and have forgotten most of what I ever knew. The pages on [b]scott's[/b] link are tailored for CentOS 5 which is the section in which you are posting and in your first post you specifically said you were using 5.3 which is what prompted me to tell you to update it :-) If you're using 6.3 then this post should be in the CentOS 6 forums and you might attract answers from someone who has experience there. If you confirm which one you are running then I am sure a moderator will move this thread if it's in the wrong place.

mypass604
Posts: 21
Joined: 2010/06/06 08:48:12

Re: Need help for adding userss and groups in Openldap server.

Post by mypass604 » 2012/10/23 16:51:50

thanks again for your reply. Well i am using CentOS 5.3. I know it is too much old but on the other side the system which I am using is also old one. :) .I am doing it just for my own practice. Thanks for the link which u gave me and if there is another more please much share with me.

regards

User avatar
TrevorH
Site Admin
Posts: 33220
Joined: 2009/09/24 10:40:56
Location: Brighton, UK

Re: Need help for adding userss and groups in Openldap server.

Post by TrevorH » 2012/10/23 18:28:33

So, the latest version of CentOS 5 is 5.8 and is about 3 years newer than the 5.3 version you are running. CentOS 6 on the other hand, the current release is 6.3. If you have 5.3 then you should `yum update` ASAP to get to 5.8.

Post Reply