converting password hashes
Stefan Eßer
se at freebsd.org
Tue Oct 29 13:14:10 UTC 2019
On 29.10.19 13:49, Jan Martin Mikkelsen wrote:
>> On 29 Oct 2019, at 13:13, Wojciech Puchar <wojtek at puchar.net> wrote:
>>
>> i want to convert accouts from one system where there was mail-only accounts using dovecot/postfix based system and SQL tables to my system, where accounts are real unix accounts - that do mail and other things.
>>
>> I don't know all people's plaintext passwords, and i don't need to and want to, but i want new accounts to work with the same passwords
>>
>> in SQL tables there are entries like this:
>>
>> $1$aab7638c$Cn7BA/oU4mzr0QltXzV7Z0
>>
>> and these works by simple cut and paste to /etc/master.passwd file
>>
>>
>> but there are entries like:
>>
>> {PLAIN-MD5}c575f55800a549930b9063b43af04f47
>>
>> that doesn't
>>
>>
>> is there a way to make it work without contacting over hundred people and telling them what new password they have?
>
> If it is just MD5 with no salt, I suspect substituting “$1$$” for the “{PLAIN_MD5}” would be sufficient.
I have not checked the code, this might even work (if there is no check
for a non-empty hash).
But the plain MD5 hashes have to be converted from hex to base64, too,
since that is the expected encoding for $1$ password entries ...
Regards, STefan
More information about the freebsd-hackers
mailing list