Check Password Strength Using cracklib-check on Ubuntu 20.04

Check Password Strength Using cracklib-check on Ubuntu 20.04

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

This tutorial shows how to install and use cracklib-check on Ubuntu 20.04.

Install cracklib-check

First, update update the package lists:

sudo apt update

The libcrack2 package contains cracklib-check command. So install libcrack2 using the following command:

sudo apt install -y libcrack2

Testing cracklib-check

Run the cracklib-check command:

cracklib-check

The command is waiting 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 exit.

Password can be provided with echo command as well:

echo "je2quieP" | cracklib-check

You will get output:

je2quieP: OK

Uninstall cracklib-check

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

sudo apt purge --autoremove -y libcrack2

Leave a Comment

Cancel reply

Your email address will not be published.