Skip to main content
1 of 2
jesse_b
  • 41.6k
  • 14
  • 108
  • 162

This is most likely only happening because you are changing the password with root and by default root is allowed to do whatever root wants.

If you su - test375 and then try to set your own password it would most likely fail. However you want to check /etc/pam.d/common-password and ensure it has this line:

password requisite pam_pwquality.so retry=3 

Which it most likely does because otherwise you wouldn't get that warning. If you really want to ensure root can't set unsecure passwords you can modify that line to:

password requisite pam_pwquality.so retry=3 enforce_for_root

This will enforce the password policy even when sudo is used.

jesse_b
  • 41.6k
  • 14
  • 108
  • 162