Information
The /etc/security/opasswd file stores the users' old passwords and can be checked to ensure that users are not recycling recent passwords.
Forcing users not to reuse their past 5 passwords make it less likely that an attacker will be able to guess the password.
Solution
NOTE: Pay special attention to the configuration. Incorrect configuration can cause system lock outs or unexpected behavior. This is example configuration. You configuration may differ based on previous changes to the files.
Edit the /etc/pam.d/common-password file to include:
- password required pam_pwhistory.so remember=5
- use_authtok on the pam_unix.so line
Example:
password required pam_pwhistory.so remember=5
password [success=1 default=ignore] pam_unix.so obscure sha512 use_authtok