2

I am trying to migrate old Centos 4.3 box to Centos 7. I have followed the migration steps from an article published way long back on http://www.cyberciti.biz/faq/howto-move-migrate-user-accounts-old-to-new-server/.

At the time of configuring postfix and dovecot I realized (nearly after two days) that migrated passwords are stored in shadow file has different (md5) encryption than one (sha512) being used in new system.

I have two question now 1) Is it correct method of migration? 2) Is there any way of converting password file from md5 to sha512

Or I need to do something else? Thank you.

2 Answers2

4

You shouldn't need to convert the passwords, the system should be able to use the old hash system. It's a good idea though to encourage users to change their passwords so that it's stored in a newer, better format in the future.

Conversion from MD5 to SHA is not possible because the hashing is not reversible - the system works not by decrypting the password to check it but by hashing the user input and check if the result is the same.

Sven
  • 100,763
3

You can enforce users to update their password at next login with:

chage -d 0 username1
chage -d 0 username2
...

so that they move to sha512 hash.

tonioc
  • 1,085