[RESOLVED] How to change minimum password length

Support for security such as Firewalls and securing linux
Post Reply
colinous
Posts: 6
Joined: 2011/06/29 09:49:19
Location: France

[RESOLVED] How to change minimum password length

Post by colinous » 2011/06/29 10:01:06

Hi,
I'm trying to change the minimum password length in CentOS-5.6.
I changing variable "PASS_MIN_LEN 7" in file "/etc/login.defs" but no effect.
How can I do that?
Thanks.

User avatar
TrevorH
Site Admin
Posts: 32276
Joined: 2009/09/24 10:40:56
Location: Brighton, UK

Re: How to change minimum password length

Post by TrevorH » 2011/06/29 10:24:13

It's no longer used from /etc/login.defs but uses pam instead. The relevant file appears to be /etc/pam.d/passwd whcih just includes /etc/pam.d/system-auth and that uses pam_cracklib.so. Running `man pam_cracklib` shows that it accepts a minlen=x parameter

colinous
Posts: 6
Joined: 2011/06/29 09:49:19
Location: France

Re: How to change minimum password length

Post by colinous » 2011/06/29 12:28:23

Yes I tried but it doesn't work
file /etc/pam.d/passwd :
#%PAM-1.0
auth include system-auth
account include system-auth
password requisite pam_cracklib.so minlen=8 retry=3
#password include system-auth

I can create a new user with password length = 6
I don't understand :-(

colinous
Posts: 6
Joined: 2011/06/29 09:49:19
Location: France

Re: How to change minimum password length

Post by colinous » 2011/06/29 16:12:38

#%PAM-1.0
auth include system-auth
account include system-auth
password required pam_cracklib.so minlen=15
password required pam_unix.so use_authtok

But with my user a can modify my password with "fadejklpzobfss"

colinous
Posts: 6
Joined: 2011/06/29 09:49:19
Location: France

[RESOLVED] Re: How to change minimum password length

Post by colinous » 2011/07/05 12:13:49

But with my user a can modify my password with "fadejklpzobfss" but "fadejklpzobfs" doesn't.
Solution is well using pam_cracklib.so with minlen=x.
Thanks TrevorH

[RESOLVED]

User avatar
AlanBartlett
Forum Moderator
Posts: 9344
Joined: 2007/10/22 11:30:09
Location: ~/Earth/UK/England/Suffolk
Contact:

[RESOLVED] How to change minimum password length

Post by AlanBartlett » 2011/07/05 15:28:48

Thank you for reporting back with your findings.

On your behalf, and for posterity, this thread is now marked [RESOLVED].

Post Reply