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 module which stands for Pluggable Authentication Modules". Man page here: Article here:

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+)(*)}{$1 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


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.