3 ms·
For user accounts on a Linux system, this is often done during the change process. `passwd` asks for the old password, and then the new password twice. At thi
by acranox 7y ago
For user accounts on a Linux system, this is often done during the change process. `passwd` asks for the old password, and then the new password twice. At this phase, the password program knows both the old and new passwords unhashed, and can compare them. So while the other answers may also be right, if it's really just comparing the current password to the old one, then it can be done this way without storing passwords in plaintext.
But it was a little unclear to me from your description how many old passwords are being compared, or if the the password change method requires entering the old one too.