Linux用不同的方法来检查密码的复杂性并获取强度和得分

简介: Linux用不同的方法来检查密码的复杂性并获取强度和得分

We all know the password importance. It’s a best practices to use complex password.

Also, I recommend you to use the different password for each services such as email, ftp, ssh, etc.,

On top of that you should change the password frequently to avoid any unnecessary hacking attempt.By default RHEL and it’s clone uses cracklib module to check password strength.

We are going to discuss, how to check the password strength using cracklib module.

If you would like to check the password score which you have created then use the pwscore package.

If you would like to create a good password, basically it should have minimum 12-15 characters length.It should be created in the following combinations like, Alphabets (Lower case & Upper case), Numbers and Special Characters.

There are many utilities are available in Linux to check a password complexity and we are going to discuss about cracklib module today.

How to install cracklib module in Linux?

The cracklib module is available in most of the distribution repository so, use the distribution official package manager to install it.

For Fedora system, use DNF Command to install cracklib.

$ sudo dnf install cracklib

For Debian/Ubuntu systems, use APT-GET Command or APT Command to install libcrack2.

$ sudo apt install libcrack2

For Arch Linux based systems, use Pacman Command to install cracklib.

$ sudo pacman -S cracklib

For RHEL/CentOS systems, use YUM Command to install cracklib.

$ sudo yum install cracklib

For openSUSE Leap system, use Zypper Command to install cracklib.

$ sudo zypper install cracklib

How to use cracklib module in Linux to check Password complexity?

I have added few example in this article to make you understand better about this module.

If you use words like, person’s name or place name or common word then you will be getting an message “it is based on a dictionary word”.

$ echo "password" | cracklib-check
password: it is based on a dictionary word

The default password length in Linux is Seven characters. If you give any password less than seven characters then you will be getting an message “it is WAY too short”.

$ echo "123" | cracklib-check 
123: it is WAY too short

You will be getting OK When you give good password like us.

$ echo "ME$2w!@fgty6723" | cracklib-check
ME!@fgty6723: OK

How to install pwscore in Linux?

The pwscore package is available in most of the distribution official repository so, use the distribution package manager to install it.

For Fedora system, use DNF Command to install libpwquality.

$ sudo dnf install libpwquality

For Debian/Ubuntu systems, use APT-GET Command or APT Command to install libpwquality.

$ sudo apt install libpwquality

For Arch Linux based systems, use Pacman Command to install libpwquality.

$ sudo pacman -S libpwquality

For RHEL/CentOS systems, use YUM Command to install libpwquality.

$ sudo yum install libpwquality

For openSUSE Leap system, use Zypper Command to install libpwquality.

$ sudo zypper install libpwquality

If you are given any words like, person name or place name or common word then you will be getting a message “it is based on a dictionary word”.

$ echo "password" | pwscore
Password quality check failed:
 The password fails the dictionary check - it is based on a dictionary word

The default password length in Linux is Seven characters. If you give any password less than seven characters then you will be getting an message “it is WAY too short”.

$ echo "123" | pwscore
Password quality check failed:
 The password is shorter than 8 characters

You will be getting password score When you give good password like us.

$ echo "ME!@fgty6723" | pwscore
90
相关文章
|
1月前
|
监控 Linux
如何检查 Linux 内存使用量是否耗尽?这 5 个命令堪称绝了!
本文介绍了在Linux系统中检查内存使用情况的5个常用命令:`free`、`top`、`vmstat`、`pidstat` 和 `/proc/meminfo` 文件,帮助用户准确监控内存状态,确保系统稳定运行。
377 6
|
2月前
|
监控 数据可视化 Ubuntu
|
2月前
|
Ubuntu Linux 网络安全
在Linux上安装软件有多种方法
在Linux上安装软件有多种方法
128 64
|
1月前
|
缓存 Linux
如何检查 Linux 内存使用量是否耗尽?
何检查 Linux 内存使用量是否耗尽?
|
1月前
|
安全 算法 Linux
Linux 服务器还有漏洞?建议使用 OpenVAS 日常检查!
在数字化时代,Linux 服务器的安全至关重要。OpenVAS 是一款优秀的开源漏洞扫描工具,可以帮助及时发现并修复服务器中的安全隐患。本文将介绍 OpenVAS 的主要功能、使用方法及应对漏洞的措施,帮助用户加强服务器安全管理,确保企业数字化安全。
59 7
|
2月前
|
存储 监控 固态存储
如何在 Linux 上检查 SSD/HDD 健康状况?
【10月更文挑战第14天】
167 1
如何在 Linux 上检查 SSD/HDD 健康状况?
|
1月前
|
Linux Shell 数据库
文件查找是Linux用户日常工作的重要技能介绍了几种不常见的文件查找方法
文件查找是Linux用户日常工作的重要技能。本文介绍了几种不常见的文件查找方法,包括使用`find`和`column`组合、`locate`和`mlocate`快速查找、编写Shell脚本、使用现代工具`fd`、结合`grep`搜索文件内容,以及图形界面工具如`Gnome Search Tool`和`Albert`。这些方法能显著提升文件查找的效率和准确性。
53 2
|
2月前
|
运维 Linux
Linux查找占用的端口,并杀死进程的简单方法
通过上述步骤和命令,您能够迅速识别并根据实际情况管理Linux系统中占用特定端口的进程。为了获得更全面的服务器管理技巧和解决方案,提供了丰富的资源和专业服务,是您提升运维技能的理想选择。
85 1
|
2月前
|
运维 安全 Linux
Linux文件清空的五种方法总结分享
每种方法各有优势,选择最合适的一种或几种,可以极大提高您的工作效率。更多有关Linux系统管理的技巧与资源,欢迎访问,持续提升您的运维技能。
85 1
|
2月前
|
Linux Shell 数据安全/隐私保护
Linux如何在服务器上进行密码的修改?
【10月更文挑战第6天】Linux如何在服务器上进行密码的修改?
248 1