Generating passwords for LDAP

When I generate LDIF entries for new LDAP users, I need to populate the userPassword field with a crypt password or an SHA1 or MD5 hash. Sun’s directory server comes with the getpwenc utility to assist with this:

$ getpwenc CRYPT password
{crypt}g72FJndhHyuiob

In addition to generating crypt passwords, it can also create MD5 and SHA1 hashes.

1 thought on “Generating passwords for LDAP”

Leave a Reply

Your email address will not be published. Required fields are marked *