0

When i tried to set the password complexity by adding the values in /etc/pam.d/common-password and /etc/security/pwquality.conf. I have set the minlen=8, for other user it works fine for root user its not working.

How i can set the minlen=8 for root user.

1 Answers1

1

This is answered in the man page:

enforce_for_root

The module will return error on failed check even if the user changing the password is root. This option is off by default which means that just the message about the failed check is printed but root can change the password anyway.

Simply add enforce_for_root to a line by it self in /etc/security/pwquality.conf.

Note that root can bypass this more or less at will by injecting their password hash. There's ultimately few things that stops root from ignoring configuration on Linux.

vidarlo
  • 22,691