First of all, I'm a beginner with LDAP. I use it on my workstation to emulate a production environment for web application I'm working on. So I'm not logged through LDAP and the users there are different than the real users on the workstation.

I have set up LDAP using the standard procedure (dpkg-reconfigure). I also setup phphLDAPadmin and I can login as admin or as a regular user and change is password (as in this video).

However, I haven't succeeded in changing the password from command-line. I have tried different options for ldappasswd but can't figure out the correct combination.

For the sake of the example, let's imagine that:

  • we want to change the login of user cronaldo (which is different than my current login)
  • users are in the People ou
  • the domain test.institute.fr

Can someone provide a working example? It would be great to be prompted for password instead of having to write them on the CLI.

I use Ubuntu 14.04 and OpenLDAP 2.4.31 (from repositories).

  • 1
    Does cronaldo immediately drop to the floor clutching his leg when given a challenging command to run? – Arronical Sep 8 '16 at 14:02
  • No he usually tries to avoid contact ;). And I usually try to google and ask colleagues before ;) – Mathieu Dubois Sep 8 '16 at 14:20

OK, I find it and it was not that hard (I got lost with SASL stuff that are not relevant). The command is:

ldappasswd -H ldap://localhost -D 'cn=Cristiano Ronaldo,ou=People,dc=test,dc=institute,dc=fr' -W 'cn=Cristiano Ronaldo,ou=People,dc=test,dc=institute,dc=fr' -S`


  • -D is used to specify the binding user
  • -W is used to prompt password for the binding user
  • -S is used to prompt the new password

One trick was to use the cn (Cristiano Ronaldo) and not the uid (cronaldo). Note that you will be asked first for the new password twice and then for the current password.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.