4.4.2.4.2 Ensure pam_unix does not include remember

Information

The remember=n argument saves the last n passwords for each user in /etc/security/opasswd in order to force password change history and keep the user from alternating between the same password too frequently. The MD5 password hash algorithm is used for storing the old passwords. Instead of this option the pam_pwhistory module should be used. The pam_pwhistory module saves the last n passwords for each user in /etc/security/opasswd using the password hash algorithm set on the pam_unix module. This allows for the sha512 hash algorithm to be used.

The remember=n argument should be removed to ensure a strong password hashing algorithm is being used. A stronger hash provides additional protection to the system by increasing the level of effort needed for an attacker to successfully determine local user's old passwords stored in /etc/security/opasswd

Solution

Edit the files /etc/pam.d/system-auth and /etc/pam.d/password-auth:

Edit the following lines and remove the remember= option:

auth sufficient pam_unix.so try_first_pass
account required pam_unix.so
password sufficient pam_unix.so sha512 shadow try_first_pass use_authtok
session required pam_unix.so

See Also

https://workbench.cisecurity.org/benchmarks/15965

Item Details

Category: IDENTIFICATION AND AUTHENTICATION

References: 800-53|IA-5(1), CSCv7|4.4

Plugin: Unix

Control ID: aa639f311df08a0fc4a26211311d67de94c29b489e11c8d778935db6cfb9ce09