Raspberry Pi

Check Password Strength Using cracklib-check on Raspberry Pi

Setting a strong password is the most important aspect of a system as it enables the users to secure servers, devices, accounts, and so on. The reason is that a hacker cannot easily retrieve a strong password containing different characters.

If you are considering setting a password for your Raspberry Pi and don’t have information on the password strength, then you should install cracklib-check on your Raspberry Pi device. The cracklib-check is a Linux-based command-line tool for finding the password strength on several Linux platforms like Raspberry Pi OS.

This article presents a detailed guide to install cracklib-check on your Raspberry Pi device.

Check Password Strength Using cracklib-check on Raspberry Pi

The cracklib-check is a command-line tool that you can install on your Raspberry Pi device through the following steps:

Step 1: Update Packages

Initially, you just need to execute the following command to perform a package update on your Raspberry Pi.

$ sudo apt update && sudo apt upgrade

Step 2: Install cracklib on Raspberry Pi

After performing the update process, you can run the following command to install cracklib on Raspberry Pi device:

$ sudo apt install libcrack2 -y

Step 3: Run cracklib-check on Raspberry Pi

Once the cracklib-check installation is completed, you can run it on your Raspberry Pi using the following command:

$ cracklib-check

After running the above command, you just need to add a password of your choice and once you press Enter, you will be able to see how strong your password is. The password we enter outputs the message with “OK” which means that your password is fine enough to be used in other places.

If you write a weak password, you will get an output “it is too short”.

If you enter a bad password, you may get an output confirming that “it is based on a dictionary” means that you have to change it soon.

You can also check the password through the following command:

$ echo "<password>" | cracklib-check

Removing cracklib-check from Raspberry Pi

If you don’t want to utilize cracklib-check service on your Raspberry Pi device, you can remove it completely from your device using the following command:

$ sudo apt purge --autoremove libcrack2 -y


The cracklib-check is a perfect command-line tool for finding out the strength of the password. You can install cracklib-check on your Raspberry Pi device through a simple installation command and once you are done with it, you can use the “cracklib-check” or “echo” command to find out the password strength.

About the author

Awais Khan

I'm an Engineer and an academic researcher by profession. My interest for Raspberry Pi, embedded systems and blogging has brought me here to share my knowledge with others.