Try this Manoj K . share the information

If you don't setup the /etc/hosts file in the start then you will endup
with

ldap_bind: Invalid credentials (49)

So by default the ldap tree [base DN] comes from /etc/hosts file, whatever
domain you have there would be your new DN or ldap base tree, and if you
have dont have any domain in there then your base DN would be nodomain and
that's exactly what happened here. There are two ways I know to correct
this, first one easy and script does the job, second one is also easy but
involved manual process Method 1

sudo dpkg-reconfigure slapd

And answer like

No
testlab.dev
testlab.dev
test
test
HDB
No
Yes
No

Now try to run

ldapadd -x -D cn=admin,dc=testlab,dc=dev -w test -f base.ldif

Hopefully you will be happy Method 2

nano /etc/ldap/slapd.d/cn\=config/olcDatabase\=\{1\}hdb.ldif

Change

olcSuffix: dc=nodomain

with

olcSuffix: dc=testlab,dc=dev

Change dn, don't change anything else unless you sure what you are doing

olcAccess: {0}to attrs=userPassword,shadowLastChange by self write by anonymou
s auth by dn="cn=admin,dc=nodomain" write by * none

with

olcAccess: {0}to attrs=userPassword,shadowLastChange by self write by anonymou
s auth by dn="cn=admin,dc=testlab,dc=dev" write by * none

Change

olcRootDN: cn=admin,dc=nodomain

with

olcRootDN: cn=admin,dc=testlab,dc=dev

Remove existing ldap database

rm /var/lib/ldap/*

Restart ldap

service slapd restart

Add the following to the top your base.ldif file otherwise you will get no
such object (32) error.

dn: dc=testlab,dc=dev
dc: TESTLAB
objectClass: top
objectClass: domain

Now run the add command again and hopefully you will by happy

ldapadd -x -D cn=admin,dc=testlab,dc=dev -w test -f base.ldif





On Sun, Sep 1, 2013 at 6:37 PM, Manoj K <[email protected]> wrote:

> Hi All,
>
> Please help me to solve this issue, am getting below error, while
> configuring LDAP on my test server.
>
> # ldapadd -x -D "cn=Manger,dc=examexample,dc=com" -W -f
> examexample.com.ldif
> Enter LDAP Password:
> ldap_bind: Invalid credentials (49)
>
>
>
>
> --
> -------------------------------------------------------------------------
>
> *Thanks&Regards*
> **********************
> *Manoj k
> Bangalore.*
> *
> *****************************************************************************************
> *
> "I will not say that i have failed a thousand times.I will say i have
> found a thousand ways that will cause failure"
>
> --
> --
> "Freedom is the only law".
> "Freedom Unplugged"
> http://www.ilug-tvm.org
>
> You received this message because you are subscribed to the Google
> Groups "ilug-tvm" group.
> To control your subscription visit
> http://groups.google.co.in/group/ilug-tvm/subscribe
> To post to this group, send email to [email protected]
> To unsubscribe from this group, send email to
> [email protected]
>
>
>
> For details visit the google group page:
> http://groups.google.com/group/ilug-tvm?hl=en
>
> ---
> You received this message because you are subscribed to the Google Groups
> "Free Software Users Group, Thiruvananthapuram" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to [email protected].
> For more options, visit https://groups.google.com/groups/opt_out.
>

-- 
-- 
"Freedom is the only law". 
"Freedom Unplugged"
http://www.ilug-tvm.org

You received this message because you are subscribed to the Google
Groups "ilug-tvm" group.
To control your subscription visit 
http://groups.google.co.in/group/ilug-tvm/subscribe
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to
[email protected]



For details visit the google group page: 
http://groups.google.com/group/ilug-tvm?hl=en

--- 
You received this message because you are subscribed to the Google Groups "Free 
Software Users Group,  Thiruvananthapuram" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
For more options, visit https://groups.google.com/groups/opt_out.

Reply via email to