Server Fault is a question and answer site for system and network administrators. It's 100% free, no registration required.

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

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:


# 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.

Any ideas are welcome...

share|improve this question
up vote 4 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

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

Your Answer


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.