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

I've configured OpenLDAP following the Ubuntu guide (with some minor edits, such as setting a proper password, my own domain name, and creating a staff group instead of an example one under people) through all steps except Replication.

Everything works just fine, except I can't use ldapscripts....

When I execute:

sudo ldapadduser dave staff

I get an LDAP error, and the /var/log/ldapscripts.log states:

>> 05/29/11 - 13:22 : Command : /usr/sbin/ldapadduser dave staff
ldap_bind: Invalid credentials (49)
ldap_bind: Invalid credentials (49)
Error adding user dave to LDAP

I'm pretty lost... I checked backend, frontend, /etc/ldapscripts/ldapscripts.passwd and the password matches...

My ldapscripts.conf file properly states:

SERVER=localhost
BINDDN="cn=admin,dc=mydomain,dc=com"

# The following file contains the raw password of the binddn
# Create it with something like : echo -n 'secret' > $BINDPWDFILE
# WARNING !!!! Be careful not to make this file world-readable
# DEBIAN: /etc/pam_ldap.secret or /etc/ldap.secret are used.
BINDPWDFILE="/etc/ldapscripts/ldapscripts.passwd"

Any ideas are welcome...

share|improve this question
add comment

2 Answers

up vote 2 down vote accepted

Write the password in to the file in this way:

echo -n "yourpassword" > /etc/ldapscripts/ldapscripts.passwd
share|improve this answer
    
This! Unbelievable. +1, thank you! I had pasted my password into the ldapscripts.passwd file in vi. As soon as I did this and only this, it worked. Why is this? –  Shabbyrobe Nov 17 '11 at 6:22
    
Vi inserts and end-of-line terminator after every line, including the last one in the file. Check the size of the files written with vi and echo -n. You can disable this in vi using :set noendofline binary before saving the file. –  Daniel Nov 17 '11 at 11:42
add comment

Are you sure about the credentials in your ldapscripts.conf file? You can test with ldapwhoami -x -D cn=admin,dc=mydomain,dc=com -y /etc/ldapscripts/ldapscripts.passwd.

share|improve this answer
add comment

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.