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.

This article was posted by Matty on 2007-01-17 19:59:00 -0400 -0400