[Dovecot] How to manually generate a password hash

René Neumann lists at necoro.eu
Sun Apr 14 12:40:23 EEST 2013


Am 14.04.2013 04:10, schrieb David Murphy:
> Hi folks. I've recently set up a Postfix 2.9.6/Dovecot 2.0.19 IMAPS/SMTPS setup on Ubuntu 12.04.2 (Mysql backend). I'm new to all this, so I apologize if this is fairly basic. I've attempted to the best of my ability to search for an answer, but no luck so far.
> 
> What I'm trying to do is generate a password hash that I can inject directly into my Mysql database (disaster recovery sort of situation). Towards that goal, I'm trying to use 'doveadm pw' to generate a hash that matches a known password in my database. Unfortunately, I'm coming up empty.
> 
> My default_pass_scheme in dovecot-sql.conf is set to MD5-CRYPT, and the passwords in the database have no scheme prefixes. I'm attempting to generate a hash with:
> 
>   sudo doveadm pw -s 'MD5-CRYPT'
> 
> but the hash generated does not match the user's password hash in the database, which is known to be a good password.

*-CRYPT hashes are salted. Hence it is intended, that hashes differ.

$ doveadm pw -s 'MD5-CRYPT' -p test
{MD5-CRYPT}$1$s3UfgF6q$YRupP9GlEcaU5CYUOfkFl0
$ doveadm pw -s 'MD5-CRYPT' -p test
{MD5-CRYPT}$1$yVZQVf8U$aaguS/rkQOJXu29V76nUl/

> I've also tried using the -p flag and including the password in the command, and that doesn't do it either, though it oddly gives a different response than using the prompt. (What causes this? Newlines?)

I don't understand what you are trying to say here...

- René


More information about the dovecot mailing list