Information
minlen - Minimum acceptable size for the new password (plus one if credits are not disabled which is the default). Cannot be set to lower value than 6.
Strong passwords protect systems from being hacked through brute force methods.
Solution
Create or modify a file ending inconf in the /etc/security/pwquality.conf.d/ directory or the file /etc/security/pwquality.conf and add or modify the following line to set password length of 14 or more characters. Ensure that password length conforms to local site policy:
Example:
# sed -ri 's/^s*minlens*=/# &/' /etc/security/pwquality.conf
# printf '
%s' "minlen = 14" >> /etc/security/pwquality.conf.d/50-pwlength.conf
Run the following script to remove setting minlen on the pam_pwquality.so module in the PAM files:
#!/usr/bin/env bash
{
for l_pam_file in system-auth password-auth; do
l_authselect_file="/etc/authselect/$(head -1 /etc/authselect/authselect.conf | grep 'custom/')/$l_pam_file"
sed -ri 's/(^s*passwords+(requisite|required|sufficient)s+pam_pwquality.so.*)(s+minlens*=s*[0-9]+)(.*$)/14/' "$l_authselect_file"
done
authselect apply-changes
}