Check Password Strength Using cracklib-check on Raspberry Pi

Check Password Strength Using cracklib-check on Raspberry Pi

The cracklib-check is a command line tool that enables to check password strength. This tool checks whether the password is based on a dictionary word, it is too short, it contains not enough different characters, etc.

This tutorial explains how to install and use cracklib-check on Raspberry Pi.

Connect to Raspberry Pi via SSH. The cracklib-check command belongs to the libcrack2 package. So update the package lists and install libcrack2 with commands:

sudo apt update
sudo apt install -y libcrack2

Now simply run the cracklib-check command:

cracklib-check

The command waits for passwords. Type a password and press Enter key. Command will tell whether the password is secure.

hello123
hello123: it is based on a dictionary word
bv159
bv159: it is too short
123456
123456: it is too simplistic/systematic
trtrtrt
trtrtrt: it does not contain enough DIFFERENT characters
je2quieP
je2quieP: OK

Press CTRL+C to quit.

We can also use echo command to provide the password with a pipe to cracklib-check:

echo "je2quieP" | cracklib-check

Output:

je2quieP: OK

If you want to completely remove cracklib-check and related dependencies, execute the following command:

sudo apt purge --autoremove -y libcrack2

Leave a Comment

Cancel reply

Your email address will not be published.