Simpler Navigation for Servers and Operating Systems - Please Update Your Bookmarks
Completed: a much simpler Servers and Operating Systems section of the Community. We combined many of the older boards, so you won't have to click through so many levels to get at the information you need. Check the consolidated boards here as many sub-forums are now single boards.
If you have bookmarked forums or discussion boards in Servers and Operating Systems, we suggest you check and update them as needed.
Showing results for 
Search instead for 
Did you mean: 

password must be atleast 12 characters long -- how ?

Go to solution
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


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

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 nullok md5 shadow minlen=12

Chris Xu
Trusted Contributor

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 service=system-auth
account required service=system-auth
password required 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/ retry=3 type=

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