htdigest file format htdigest file format apache apache

htdigest file format


echo by default adds a trailing new line:

echo -n a:b:c | md5

Should work as you expect.


Hm, I seem to have answered my own question. My test case was flawed, 'echo' is adding extra characters (not sure which). For instance

echo a:b:c | wc

gives 6 characters instead of 5. Calculating the hash at http://md5-hash-online.waraxe.us/ gives the correct value. Sorry everyone!


Here is how you set the password for a given user.

sudo htdigest /etc/apache2/.htdigest yourrealm.com yourusername