Download as txt, pdf, or txt
Download as txt, pdf, or txt
You are on page 1of 1

Set password complexity in DEB based systems

---------------------------------------------------------
This setting enforces how many classes, i.e upper-case, lower-case, and other
characters, should be in a password.

First install password quality checking library using command:

sudo apt install libpam-pwquality


Then, edit /etc/pam.d/common-password file:
sudo nano /etc/pam.d/common-password
___________________________________

To set at least one upper-case letters in the password, add a word 'ucredit=-1' at
the end of the following line.

password requisite pam_pwquality.so retry=3 ucredit=-1


_______________________________________________________________

Set at least one lower-case letters in the password as shown below.

password requisite pam_pwquality.so retry=3 dcredit=-1


_________________________________________________________________

Set at least other letters in the password as shown below.


password requisite pam_pwquality.so retry=3 ocredit=-1
_________________________________________________________________

As you see in the above examples, we have set at least (minimum) one upper-case,
lower-case, and a special character in the password. You can set any number of
maximum allowed upper-case, lower-case, and other letters in your password.

You can also set the minimum/maximum number of allowed classes in the password.

The following example shows the minimum number of required classes of characters
for the new password:

password requisite pam_pwquality.so retry=3 minclass=2


____________________________________________________________________________

You might also like