Question: How to change the minimum password length for a user in a CentOS/RHEL 7 box? What is the lowest minimum value possible for the password length?
The easiest way to set the password lenght for users is to add or modify the “minlen” parameter in /etc/security/pwquality.conf.
For example :
$ cat /etc/security/pwquality.conf minlen= 6
However, the length can never be shorter than 6 characters. This is hardcoded into the pam_pwquality module shipped by Red Hat and therefore cannot be changed without rebuilding it (and therefore losing support).
Snippet of the source code where the minimum lenght is hardcoded in pam_pwquality:
#define PWQ_BASE_MIN_LENGTH 6 /* used when lower than this value of min len is set */