Linux – pam_cracklib: preventing users from using passwords that contain common words

crackliblinuxpassword

We would like to prevent users from using words such as the organisation name or their username as part of the password. The default behaviour of pam_cracklib when given a dictionary seems to be to disallow any passwords that are the words contained in the dictionary, as follows:

password  required  pam_cracklib.so dictpath=/usr/share/cracklib/pw_dict

This gives the following behaviour:

passwd username
Changing password for username.
New password: salesperson
BAD PASSWORD: it is based on a dictionary word.
^C

however, simply repeating the word passes:

passwd username
Changing password for username.
New password: salespersonsalesperson
Retype new password: salespersonsalesperson
Password changed.

Is there any way to modify the password policy to prevent this?

Thanks in advance.

Best Answer

I'm fairly certain pam_cracklib can't check against repeat words (unless you created a dictionary of doubled words). I think you'll find more success in setting complexity requirements (the "credits" system in pam_cracklib) than just checking against dictionary words. See man pam_cracklib for details.

Related Topic