2

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

2 Answers 2

4

Write the password in to the file in this way:

echo -n "yourpassword" > /etc/ldapscripts/ldapscripts.passwd
2
  • 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, 2011 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, 2011 at 11:42
1

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.

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .