LinuxQuestions.org
Visit Jeremy's Blog.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Server
User Name
Password
Linux - Server This forum is for the discussion of Linux Software used in a server related context.

Notices


Reply
  Search this Thread
Old 09-08-2011, 05:02 AM   #1
Rohit_4739
Member
 
Registered: Oct 2010
Distribution: Red Hat
Posts: 228

Rep: Reputation: 9
Getting ldap_bind : Invalid credentials(49) error


Hello LQ Folks,

I am getting this error when ever i am trying to add entries to my home ldap server.

ldap_bind : Invalid credentials(49)

Here is the command and its output :

ldapadd -xh localhost -D "cn=Manager,dc=test,dc=com" -w Redhat -f ldif/test.ldif

ldap_bind: Invalid credentials (49)

Here is my slapd.conf

Quote:
# Directives needed to implement policy:
# access to dn.base="" by * read
# access to dn.base="cn=Subschema" by * read
# access to *
# by self write
# by users read
# by anonymous auth
#
# if no access controls are present, the default policy
# allows anyone and everyone to read anything but restricts
# updates to rootdn. (e.g., "access to * by * read")
#
# rootdn can always read and write EVERYTHING!

#######################################################################
# ldbm and/or bdb database definitions
#######################################################################

database bdb
suffix "dc=test,dc=com"
rootdn "cn=Manager,dc=test,dc=com"
# Cleartext passwords, especially for the rootdn, should
# be avoided. See slappasswd(8) and slapd.conf(5) for details.
# Use of strong authentication encouraged.
rootpw Redhat
# rootpw {crypt}ijFYNcSNctBYg

# The database directory MUST exist prior to running slapd AND
# should only be accessible by the slapd and slap tools.
# Mode 700 recommended.
directory /var/lib/ldap

# Indices to maintain for this database
index objectClass eq,pres
index ou,cn,mail,surname,givenname eq,pres,sub
index uidNumber,gidNumber,loginShell eq,pres
index uid,memberUid eq,pres,sub
index nisMapName,nisMapEntry eq,pres,sub

So could you please explain me why i am getting this error.


Thanks in advance.

Last edited by Rohit_4739; 09-08-2011 at 05:04 AM.
 
Old 09-08-2011, 11:50 AM   #2
bathory
LQ Guru
 
Registered: Jun 2004
Location: Piraeus
Distribution: Slackware
Posts: 13,175
Blog Entries: 1

Rep: Reputation: 2042Reputation: 2042Reputation: 2042Reputation: 2042Reputation: 2042Reputation: 2042Reputation: 2042Reputation: 2042Reputation: 2042Reputation: 2042Reputation: 2042
Hi,

It should work as the bind dn and password are those defined in slapd.conf. Are you sure you're using that slapd.conf and not a different one?
Also since you didn't mention your distro, check if you're not running openldap with the configuration stored in cn=config instead of slapd.conf.

Regards
 
Old 03-21-2012, 04:49 AM   #3
gopa
LQ Newbie
 
Registered: Aug 2011
Posts: 13

Rep: Reputation: Disabled
Invalid Credentials 49

This is very common error while confugaring openldap.
Follow the below steps for solving

Check the slapd.conf
68 database bdb
69 suffix "dc=example,dc=com"
70 rootdn "cn=Manager,dc=example,dc=com"
71 rootpw secret

#service ldap restart

So create Test users:

#useradd test
#passwd test
Changing password for user test1.
New UNIX password:
Retype new UNIX password:
passwd: all authentication tokens updated successfully.


The users created here are the users of operating system. Now migrate them to Openldap.

Before doing this create root user with the name "root"

Now migrate:

#/usr/share/openldap/migration/migrate_passwd.pl /etc/openldap/passwd.root /etc/openldap/root.ldif (This is for root migration)
#/usr/share/openldap/migration/migrate_passwd.pl /etc/openldap/passwd.test /etc/openldap/test.ldif

After adding the root user add contents of the root as per the requirement

#vi /etc/openldap/root.ldif

dn: uid=root,ou=People,dc=adminmart,dc=com
uid: root
cn: Manager
objectClass: account


the invalid credentails are caused mostly when root user is not created.

Create a domain ldif file:

#cat /etc/openldap/example.ldif

dn: dc=adminmart,dc=com
dc: adminmart
description: LDAP Admin
objectClass: dcObject
objectClass: organizationalUnit
ou: rootobject

dn: ou=People, dc=adminmart,dc=com
ou: People
description: Users of adminmart
objectClass: organizationalUnit

Now Import local users:

ldapadd -x -D "cn=Manager,dc=example,dc=com" -W -f /etc/openldap/root.ldif

Enter LDAP Password:
adding new entry "uid=root,ou=People,dc=example,dc=com"
adding new entry "uid=operator,ou=People,dc=example,dc=com"

Restart the service:

#service ldap restart

Now test the LDAP Search by command ldapsearch:

# ldapsearch -x -b 'dc=example,dc=com' '(objectclass=*)'

Test result should be 2. No of entries=...

Hope this should help you.
 
Old 02-12-2013, 04:19 AM   #4
gopa
LQ Newbie
 
Registered: Aug 2011
Posts: 13

Rep: Reputation: Disabled
Invalid Credentials 49

We have to follow clear structure before we add users to openldap.

First we need to Create Organisation (Organisation)

Second we need to create Organisation structure (Bussiness Unit)

Thirdly we have to add inetorgperson (Group/member)

i.e follow the below structure.


dn: o=test
o: test
objectClass: organization


dn: ou=apps,o=test
ou: apps
objectClass: organizationalUnit


dn: uid=testserver.com,o=test
uid: testserver.com
sn: test
cn: group
mail: testserver@testgroup.com
userPassword: password
objectClass: person
objectClass: inetOrgPerson



By following above structure you can overcome the error.

Regards,
Gopal Varma P
 
Old 03-15-2013, 12:29 PM   #5
TB0ne
LQ Guru
 
Registered: Jul 2003
Location: Birmingham, Alabama
Distribution: SuSE, RedHat, Slack,CentOS
Posts: 26,782

Rep: Reputation: 7999Reputation: 7999Reputation: 7999Reputation: 7999Reputation: 7999Reputation: 7999Reputation: 7999Reputation: 7999Reputation: 7999Reputation: 7999Reputation: 7999
Quote:
Originally Posted by gopa View Post
We have to follow clear structure before we add users to openldap.

First we need to Create Organisation (Organisation)
Second we need to create Organisation structure (Bussiness Unit)
Thirdly we have to add inetorgperson (Group/member)

i.e follow the below structure.

By following above structure you can overcome the error.
Again, as in a couple of other threads that you've re-opened, this is not correct. It will ONLY work for someone who wants the same configuration as you. And this thread has been closed for over a year now....please don't reopen old threads for no reason.
 
  


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
ldap_bind: Invalid credentials (49) jlpeifer Linux - Server 3 11-02-2010 03:31 PM
Ldap_bind: Invalid credentials olasamuel Linux - Newbie 1 10-28-2009 10:57 AM
ldap_bind: Invalid credentials (49) soni_silver17 Linux - Server 1 01-24-2009 01:47 PM
LDAP_BIND: Invalid Credentials rupesh_pulikool Linux - Software 0 02-01-2005 01:27 PM
ldap_bind:Invalid credentials chintone Linux - General 0 12-06-2002 05:42 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - Server

All times are GMT -5. The time now is 11:31 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