LinuxQuestions.org
Latest LQ Deal: Latest LQ Deals
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Software
User Name
Password
Linux - Software This forum is for Software issues.
Having a problem installing a new program? Want to know which application is best for the job? Post your question in this forum.

Notices


Reply
  Search this Thread
Old 12-13-2012, 03:30 PM   #1
mmonette
LQ Newbie
 
Registered: Dec 2012
Posts: 3

Rep: Reputation: Disabled
Bind to LDAP with credentials


Hey,

I want to disable anonymous users being able to read/search our LDAP server. We are using OpenDJ, which is based on OpenDS. I don't really think the server has anything to do it it.

So far, I can type "ldapsearch -x -Z" and pull the entire LDAP database(minus the passwords of course)

When I change the anonymous access from "anyone" to "all" it then requires an LDAP user/password to pull the LDAP info.

ldapsearch -x -Z shows nothing, and I can no longer login as an LDAP user. That's cool!

I created a user in the base of my LDAP called "Binder" to be used to show/search/read LDAP info.

This is the command I use to view the LDAP users.

ldapsearch -x -Z -D cn=Binder,dc=example,dc=com -w pa$$w0rd

Just like before, everything in the LDAP server appears, wonderful! So it is accepting this new user and letting me read the directory.

Now. I am using Centos 6 as a client.

I add the following lines to /etc/pam_ldap.conf AND /etc/nslcd.conf
binddn "cn=Binder,dc=example,dc=com"
bindpw pa$$w0rd

But ldapsearch -x -Z still shows nothing. It is not taking those credentials and still sees me as anonymous. I still cannot "su" to an ldap user.

Is there a step I am missing? cn=binder is obvuiously working as I can manually enter the credentials and view the directory..But the lines I have added are not taking.

I may be just a bit confused with the bindpw part

Do I type the plaintext password after bindpw? or do I store it in a file called /etc/bindpw (chmod 600) and change those lines to bindpw /etc/bindpw ?

Frig, I am so close I just need a kick in the right direction for this one

I hope someone can lend me some of that expert knowledge!

Thanks dudes.
 
Old 12-14-2012, 08:55 AM   #2
acid_kewpie
Moderator
 
Registered: Jun 2001
Location: UK
Distribution: Gentoo, RHEL, Fedora, Centos
Posts: 43,417

Rep: Reputation: 1985Reputation: 1985Reputation: 1985Reputation: 1985Reputation: 1985Reputation: 1985Reputation: 1985Reputation: 1985Reputation: 1985Reputation: 1985Reputation: 1985
the bindpw IS the password yes, but you seem to have jumped a few steps here. you need "getent passwd" to return the user data first, don't worry about logins until you can see the accounts. Additionally you don't seem to have gotten it working without the bind account anyway, so there's no reason to think that it's actually realted to the bind creds.
 
Old 12-14-2012, 09:55 AM   #3
mmonette
LQ Newbie
 
Registered: Dec 2012
Posts: 3

Original Poster
Rep: Reputation: Disabled
Actually, nope,

I did not skip any steps, I have never in my life once used getent (Maybe I should start?)

Heres how it's done.


Created a user in the base of the ldap called Binder, no posix classes, simple user.

vi /etc/nslcd.conf
binddn cn=Binder,dc=example,dc=com
bindpw pa55word

vi /etc/pam_ldap.conf
binddn cn=Binder,dc=example,dc=com
bindpw pa55word

service nslcd restart
ldapsearch -x -Z
No info shown, GOOD!

ldapsearch -x -Z -D cn=Binder,dc=example,dc=com

Info shown, GOOD!

su - Divebomb

GOOD!

For my tests I was doing "ldapsearch -x -Z" thinking that it would automatically enter the user/password from the config files. I never actually attempted to su - Divebomb. I assumed that ldapsearch returned nothing, su wouldn't work.

I appreciate the reply!!!

Have a great day everyone.
 
Old 12-14-2012, 02:58 PM   #4
acid_kewpie
Moderator
 
Registered: Jun 2001
Location: UK
Distribution: Gentoo, RHEL, Fedora, Centos
Posts: 43,417

Rep: Reputation: 1985Reputation: 1985Reputation: 1985Reputation: 1985Reputation: 1985Reputation: 1985Reputation: 1985Reputation: 1985Reputation: 1985Reputation: 1985Reputation: 1985
well by missed a step i meant in terms of the appropriate checks that you're going OK. you changed multiple things at once, and were left not knowing what was wrong.

But anyway, ldapsearch does NOT use /etc/ldap.conf, it uses the totally different file /etc/openldap/ldap.conf
 
  


Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
samba 3.5 failed to bind to ldap server invalid credentials mercxi Linux - Server 1 07-28-2010 04:58 PM
invalid credentials (LDAP) MonsieurLeBoulet Linux - Server 2 06-15-2009 03:50 AM
ldap invalid credentials finsh Linux - Server 4 12-12-2007 12:11 PM
ldap invalid credentials johond Linux - Networking 1 12-14-2004 04:31 AM
ldap: invalid credentials johond Debian 0 12-14-2004 04:00 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - Software

All times are GMT -5. The time now is 03:41 AM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration