How to configure password complexity for all users including root using pam_passwdqc.so
Environment
- Red Hat Enterprise Linux 5
- Red Hat Enterprise Linux 6
- pam_passwdqc.so
Issue
- How to configure password complexity for all users including root using passwdqc
- Is it possible to configure/apply password complexity for all users including root using pam_cracklib module?
- Which module should I use to configure password complexity for
rootuser ? - Configure password complexity for root and other users using pam_passwdqc
- PAM pam_cracklib.so restrictions in password definition are not being forced (getting applied) to
rootaccount - Use PAM module pam_passwdqc.so to meet specific password strength criteria
- Enforce password policies for root user using
passwdqc.
Resolution
-
By default, Red Hat Enterprise Linux uses the
cracklibmodule to check password strength. However, thecracklibmodule doesn't enforce password strength checking on the "root". To enforce password checking for all accounts including the root user, another PAM module calledpasswdqccan be used instead ofcracklibmodule. -
Module
pam_passwdqc.sois provided bypam_passwdqcpackage in Red Hat Enterprise Linux:
# rpm -qf /lib64/security/pam_passwdqc.so
pam_passwdqc-1.0.5-6.el6.x86_64
- Modify the
/etc/pam.d/system-authfile as follows:
Change the following line from:
password requisite pam_cracklib.so try_first_pass retry=3
to:
password requisite pam_passwdqc.so min=disabled,12,8,6,5 max=40 passphrase=3 match=4 similar=deny random=42 enforce=everyone retry=3
- The
passwdqcmodule uses different password checking options to thecracklibmodule. For detailed information on how to modify the behaviour of thepasswdqcmodule, please refer to the man page ofpam_passwdqc:
# man pam_passwdqc
-
Note that the
passwdqcandcracklibmodules perform similar functions, and should not be used in the same PAM configuration file. It also cannot enforce password strength checking during the installation process of Red Hat Enterprise Linux. -
If configuring on a Red Hat Enterprise Linux 6 or above,
/etc/pam.d/password-authfile need to be modified as well.
This solution is part of Red Hat’s fast-track publication program, providing a huge library of solutions that Red Hat engineers have created while supporting our customers. To give you the knowledge you need the instant it becomes available, these articles may be presented in a raw and unedited form.
Comments