Get your server issues fixed by our experts for a price starting at just 25 USD/Hour. Click here to register and open a ticket with us now!

Author Topic: How To Check Password Strength With Cracklib-check Command  (Read 2720 times)

0 Members and 1 Guest are viewing this topic.

jibinw

  • Guest
How To Check Password Strength With Cracklib-check Command
« on: June 23, 2018, 01:22:06 pm »
Creating a strong and unique password for Linux or Unix-like systems
  • Create a password with mix of numbers, special symbols, and alphabets.
  • Make sure your password is hard to guess. You can use tool such as makepasswd to create hard to guess password.
  • Do not use simple words like “password”, “123456”, “123abc” or “qwerty”.
  • Use a unique password for all your server accounts.
  • A minimum password length of 12 to 14 characters should be used. See how to configure CentOS / RHEL / Fedora Linux based server password quality requirements.
  • Generating passwords randomly where feasible. You can do this with a simple shell script function.
  • If possible use two-factor authentication.
  • Use pam_crack to ensure strong passwords and to check passwords against a dictionary attack.
But, how do you test the effectiveness of a password in resisting guessing and brute-force attacks under Linux? The answer is simple use cracklib-check command.

Code: [Select]
[b]Install cracklib on a Linux based system[/b]
Type the following yum command to install on RHEL and friends:

Code: [Select]
# yum install cracklib[/size]

Type the following apt-get command to install on Debian/Ubuntu and friends:

Code: [Select]
# apt-get install libcrack2
Examples

Test a simple password like “password”, enter:

Code: [Select]
$ echo "password" | cracklib-check
Sample outputs:

password: it is based on a dictionary word

Try sequential patterns such as “abc123456”:

Code: [Select]
$ echo "abc123456" | cracklib-check
Sample outputs:

abc123456: it is too simplistic/systematic

Try a password with a mix of letters, numbers, and symbols:

Code: [Select]
$ echo 'i1oVe|DiZza' | cracklib-check
Sample outputs:

i1oVe|DiZza: OK

Regards..