Our server is currently using the blowfish cipher to store passwords and it uses pam_unix2. We'd like to gradually switch to SHA. The idea is that all newly changed passwords would be hashed with SHA. But I don't know how to configure PAM for that, namely common-password
. If I use pam_unix2
, it cannot save new passwords with SHA. If I use pam_unix
, it cannot verify old, blowfish passwords. Is there a way how to verify the old passwords with one module and set new with another?
It depends on whether the
password
interface checks the current password, or whether this is done by the normalauth
interface. I would suspect the latter due to root being able to set other users' passwords without providing the user's previous password, in which case you should be able to do something like this: