OpenLDAP - slappasswd and ldappasswd commands (reset password)

by
Jeremy Canfield |
Updated: March 11 2020
| OpenLDAP articles
The slappasswd command can be used to generate a hash of a users password. In this example, the hash is {SHHA}pfjf4857vjslsj4j4g8skdffj3342.
~]# slappasswd
New password: ********
Re-enter new password: ********
{SHHA}pfjf4857vjslsj4j4g8skdffj3342
Update /etc/openldap/slapd.d/cn=config/olcDatabase={2}hdb.ldif to contain the hash.
olcRootPW: {SHHA}pfjf4857vjslsj4j4g8skdffj3342
Likewise, the ldappasswd can be used to reset a users password in OpenLDAP. In this example, JohnDoe password is updated.
ldappasswd -x -D dc=example,dc=com -a <current password> -s <new password> JohnDoe
Did you find this article helpful?
If so, consider buying me a coffee over at