Server Fault is a question and answer site for system and network administrators. It's 100% free, no registration required.

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

How can I enforce mínimum length and complexity for users passwords on Linux?

Thank you

share|improve this question
up vote 6 down vote accepted

You should look into all things "pam" and particularly the pam_passwdqc.so module which stands for Pluggable Authentication Modules". Man page here: http://linux.die.net/man/8/pam_passwdqc Article here: https://web.archive.org/web/1/http://articles.techrepublic%2ecom%2ecom/5100-10878_11-6111316.html

This little perl one liner will do set password quality as per the NSA Securing Linux Guide:

perl -p -i.prekickstart -e 'BEGIN {print stderr "Configure password quality module\n";}  \
                s{(^password\s+requisite\s+)(pam_cracklib.so)(.*)}{$1 pam_passwdqc.so min=disabled,disabled,16,12,8} ;' /etc/pam.d/system-auth

(Tested on RedHat/Centos).

share|improve this answer

RedHat Kbase for password length and complexity

one more link i have use log back may be help stronger Password

share|improve this answer

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

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