I installed libpam-pwquality:

sudo apt-get install libpam-pwquality

And configured /etc/pam.d/common-password:

password        requisite                       pam_pwquality.so retry=3 minlen=10

password        [success=1 default=ignore]      pam_unix.so obscure use_authtok try_first_pass sha512
password        required                        pam_deny.so
password        required                        pam_permit.so

Then when I ran passwd, I could still set a password of 2 or 3 characters. What was missing?

  • What are the other lines? All i find refers to the first line and only this one being set! I also read later configurations overwrite earlier ones. – WGRM Mar 23 '20 at 11:52

You need to set the options in pwquality's configuration file, /etc/security/pwquality.conf.

  • this doesnt work for ubuntu 18.04 - weak passwords are still accepted :( – xhudik Sep 26 '18 at 19:20

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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