|
OpenLDAP Faq-O-Matic : OpenLDAP Software FAQ : Configuration : SLAPD Configuration : Passwords :
What are {MD5} and {SMD5} passwords and how do I generate them? |
OpenLDAP supports RFC 2307 passwords, including the
{MD5}, {SMD5} and other schemes. Such passwords may
be used as userPassword values and/or rootpw value.
See What are RFC 2307 hashed user passwords?.
|
Use of {SSHA} passwords is recommended over MD5 varients.
|
#! /usr/bin/perl
#
# This small script generates an Seeded MD5 hash of 'secret'
# (using the seed "salt") for use as a userPassword or rootpw value.
#
use Digest::MD5;
use MIME::Base64;
$ctx = Digest::MD5->new;
$ctx->add('secret');
$salt = 'salt';
$ctx->add($salt);
$hashedPasswd = '{SMD5}' . encode_base64($ctx->digest . $salt ,'');
print 'userPassword: ' . $hashedPasswd . "\n"; |
#! /usr/bin/perl
#
# This small script generates an MD5 hash of 'secret' for use
# as a userPassword or rootpw value.
#
use Digest::MD5;
use MIME::Base64;
$ctx = Digest::MD5->new;
$ctx->add('secret');
$hashedPasswd = '{MD5}' . encode_base64($ctx->digest,'');
print 'userPassword: ' . $hashedPasswd . "\n"; |
[Append to This Answer] |