Briefly, on Ubuntu, password complexity is enforced by the
In order to modify the password policy for your local machine, you will need to modify your
From a terminal window Ctrl+Alt+T enter the following:
gksu gedit /etc/pam.d/common-password
Add the following line to the file and save the file:
password requisite pam_cracklib.so ucredit=-1 lcredit=-1 dcredit=-1 ocredit=-1
This uses the following options:
dcredit == digit
ucredit == upper-case character
lcredit ==lower-case character
ocredit == other character (special characters, including
This should satisfy your requirements. You could also use the variables
retries to further restrict the password requirements.
Another good example of modifying a password policy in this manner would be the following line:
password requisite pam_cracklib.so retry=3 minlen=10 difok=3 ucredit=-1 lcredit=-1 dcredit=-1 ocredit=-1
This entry will set a maximum of three attempts at getting an acceptable password with a 10-character minimum length. This sets the requirement for users to have a minimum of three characters different from the last password. This also fulfills the requirement of having the password contain at least one each of digit, lower-case character, and upper-case character.
See also this simple explanation of available options for password requirements.