How to Evaluate and Strengthen Your Linux Passwords with Cracklib and pwscore
This guide explains why strong, unique passwords matter, outlines best‑practice guidelines, and provides step‑by‑step instructions for installing and using the Linux tools cracklib and pwscore to assess password complexity and receive quantitative strength scores.
Strong, unique passwords are the first line of defense against account compromise, yet many users reuse simple passwords that are easy to guess.
Password Best Practices
Use passwords at least 12 characters long, mixing numbers, upper‑ and lower‑case letters, and special symbols.
Avoid dictionary words, personal names, or common phrases.
Employ a different password for each service (e.g., email, messaging, banking).
Change passwords regularly.
Using cracklib
Installation
Install the tool from your distribution’s package manager:
$ sudo dnf install cracklib $ sudo apt install libcrack2 $ sudo pacman -S cracklib $ sudo yum install cracklib $ sudo zypper install cracklibChecking passwords
Run cracklib-check to see why a password is weak:
$ echo "password" | cracklib-check
password: it is based on a dictionary word $ echo "123" | cracklib-check
123: it is WAY too short $ echo "ME$2w!@fgty6723" | cracklib-check
ME$2w!@fgty6723: OKUsing pwscore
Installation
On most Linux distributions, install the package that provides pwscore (often libpwquality).
$ sudo apt install libpwqualityEvaluating password strength
pwscorereports why a password fails checks and assigns a numeric score when it passes:
$ echo "password" | pwscore
Password quality check failed: The password is based on a dictionary word
$ echo "123" | pwscore
Password quality check failed: The password is shorter than 8 characters
$ echo "ME!@fgty6723" | pwscore
90Conclusion
Even though attackers have many ways to steal data, a robust, complex password remains the simplest and most effective protection for personal information on Linux systems.
Signed-in readers can open the original source through BestHub's protected redirect.
This article has been distilled and summarized from source material, then republished for learning and reference. If you believe it infringes your rights, please contactand we will review it promptly.
Liangxu Linux
Liangxu, a self‑taught IT professional now working as a Linux development engineer at a Fortune 500 multinational, shares extensive Linux knowledge—fundamentals, applications, tools, plus Git, databases, Raspberry Pi, etc. (Reply “Linux” to receive essential resources.)
How this landed with the community
Was this worth your time?
0 Comments
Thoughtful readers leave field notes, pushback, and hard-won operational detail here.
