1

I have set minimum password length to 3 on my RHEL 7 system. Still while using passwd I get error:

BAD PASSWORD: The password is shorter than 5 characters.

I have changed following parameters:

In /etc/security/pwquality.conf:

minlen = 3

And in /etc/login.defs:

PASS_MIN_LEN  3

How passwd is getting 5 as minimum length? Which config file I am missing?

4

Read the manual http://linux.die.net/man/5/pwquality.conf . Minimum length cannot be set to a value lower than 6. And if credits are enabled—which is the default—the computed score can be higher than you compute yourself.

  • 1
    And the manual you refer to is this, correct? “Cannot be set to lower value than 6.” Might want to add that to your answer. – JakeGould Oct 8 '15 at 0:11
  • Can I disable the pwquality in pam module stack? – user746184 Oct 9 '15 at 15:23
  • I am not an expert in the issue, I would experiment: grep pwquality /etc/pam.d/* and you will see where pam_pwquality.so is used. /etc/pam.d/passwd controls behaviour of passwd utility, /etc/pam.d/password-auth controls the behaviour of programs that use password authentication (e.g. ssh). try removing pam_pwquality.so from the password stanzas? – Nik O'Lai Oct 9 '15 at 16:18
-1

Tried with a fresh CentOS 7.4 install

authconfig --passminlen=12 --update

The command changes the parameter

minlen = 12

in

/etc/security/pwquality.conf

While on an older machine (wich I can no longer recover) the same command set the minimum length to 6, even if minlen was set to a higher value

Try to check if you have in /etc/pam.d

[root@host pam.d]# cat passwd
#%PAM-1.0
auth       include      system-auth
account    include      system-auth
password   substack     system-auth

[root@host pam.d]# cat system-auth
#%PAM-1.0
# This file is auto-generated.
# User changes will be destroyed the next time authconfig is run.
[...]
password    requisite     pam_pwquality.so try_first_pass local_users_only
[...]

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.