12.15. Changing Passwords
Problem
How do you change your own password?
Solution
Use ldappassw with your own DN:
$ ldappasswd -xD "uid=cschroder,ou=people,dc=alrac,dc=net" -WS
New password:
Re-enter new password:
Enter LDAP Password:
Result: Success (0)If you leave off the -S flag, it will create a new password for you:
$ ldappasswd -xD "uid=cschroder,ou=people,dc=alrac,dc=net" -W
Enter LDAP Password:
New password: MzJiHq8n
Result: Success (0)ldapwhoami is a great way to test logins:
$ ldapwhoami -x -D "uid=cschroder,ou=people,dc=alrac,dc=net" -W
Enter LDAP Password:
dn:uid=cschroder,ou=people,dc=alrac,dc=net
Result: Success (0)Discussion
Naturally, if you prefer a graphical LDAP client, it's usually easier and faster. You should still be familiar with ldappasswd and ldapwhoami for troubleshooting because using graphical clients still requires a knowledge of OpenLDAP commands.
By default, ldappasswd hashes passwords
with SSHA. You may choose a different mechanism with the -Y flag:
SHA, SMD5, MD5, CRYPT, or CLEARTEXT. You may also set a different
default in slapd.conf, like this:
password-hash {MD5}See Also
man 1 ldappasswdman 1 slapd.confman 1 ldapwhoamiOpenLDAP.org: http://www.openldap.org/
LDAP Directories Explained: An Introduction and Analysis, by Brian Arkills (Addison-Wesley)
LDAP System Administration, by Gerald Carter (O'Reilly)
Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.
Read now
Unlock full access