Operating System - Linux
1753964 Members
7363 Online
108811 Solutions
New Discussion юеВ

password must be atleast 12 characters long -- how ?

 
SOLVED
Go to solution
Maaz
Valued Contributor

password must be atleast 12 characters long -- how ?

How can I configure/set/implement the minimum lenght of password ?

I did the following

in /etc/login.defs

PASS_MIN_LEN 12

But it doesnt work, i.e. even now users can set their password of only 6 characters.

And what I want is that password must be atleast 12 characters long.

Thanks In Advance

Regards
Maaz
2 REPLIES 2
Chris Xu
Trusted Contributor

Re: password must be atleast 12 characters long -- how ?

Add minlen=12 at the line begining with password in /etc/pam.d/passwd if you have a line like the below:

password required pam_unix.so nullok md5 shadow minlen=12

Chris
Chris Xu
Trusted Contributor
Solution

Re: password must be atleast 12 characters long -- how ?

Sorry I think I gave your incorrect info. Here is the right answer to achieve minimun 12 chars in password.

Your /etc/pam.d/passwd should look like:
auth required pam_stack.so service=system-auth
account required pam_stack.so service=system-auth
password required pam_stack.so service=system-auth

In your /etc/pam.d/system-auth file, add this minlen=12 to the line like below:
password required /lib/security/$ISA/pam_cracklib.so retry=3 type=

So your modified line should look like:
password required /lib/security/$ISA/pam_cracklib.so retry=3 type= minlen=12

Chris