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
相关文章
|
23天前
|
Linux Shell Windows
Linux如何检查文件夹的大小?
在Linux中查看文件夹大小,可使用`du`(如`du -sh *`)、`df`(如`df -h /home`)查看磁盘使用情况,`ncdu`提供交互式浏览,`ls -lh`显示当前目录文件大小,`find`与`du`结合找大文件夹,`tree --du -h`展示目录结构及大小,或用`awk`与`du`组合按大小排序。不同场景下,这些命令各有优势。
147 1
Linux如何检查文件夹的大小?
|
1月前
|
安全 Shell Linux
【Shell 命令集合 磁盘维护】Linux 检查和修复Minix文件系统 fsck.minix命令使用教程
【Shell 命令集合 磁盘维护】Linux 检查和修复Minix文件系统 fsck.minix命令使用教程
13 0
|
1月前
|
存储 监控 Shell
【Shell 命令集合 磁盘管理 】Linux 检查磁盘空间限制的状态 repquota命令使用指南
【Shell 命令集合 磁盘管理 】Linux 检查磁盘空间限制的状态 repquota命令使用指南
32 0
|
1月前
|
算法 Shell Linux
【Shell 命令集合 文档编辑】Linux 检查文本文件中的拼写错误 spell 命令使用指南
【Shell 命令集合 文档编辑】Linux 检查文本文件中的拼写错误 spell 命令使用指南
34 0
|
1月前
|
存储 安全 Shell
【Shell 命令集合 系统设置 】⭐⭐⭐Linux 更改用户密码 passwd命令 使用指南
【Shell 命令集合 系统设置 】⭐⭐⭐Linux 更改用户密码 passwd命令 使用指南
36 0
|
1月前
|
算法 Shell Linux
【Shell 命令集合 磁盘维护 】Linux 检查和修复文件系统错误 fsck命令使用教程
【Shell 命令集合 磁盘维护 】Linux 检查和修复文件系统错误 fsck命令使用教程
25 0
|
16天前
|
关系型数据库 MySQL Linux
linux CentOS 7.4下 mysql5.7.20 密码改简单的方法
linux CentOS 7.4下 mysql5.7.20 密码改简单的方法
19 0
|
23天前
|
Ubuntu Linux
常用Linux开机启动添加方法
常用Linux开机启动添加方法
15 1
|
1月前
|
安全 Linux 开发者
⭐⭐⭐⭐⭐Linux C/C++ 进程崩溃诊断以及有效数据收集:解锁代码问题快速定位与修复的方法
⭐⭐⭐⭐⭐Linux C/C++ 进程崩溃诊断以及有效数据收集:解锁代码问题快速定位与修复的方法
83 1
|
1天前
|
Linux 数据安全/隐私保护
Linux系统忘记密码的三种解决办法
这篇博客介绍了三种在Linux忘记密码时重置登录密码的方法:1) 使用恢复模式,通过控制台界面以管理员权限更改密码;2) 利用Linux Live CD/USB启动,挂载硬盘分区并使用终端更改密码;3) 进入单用户模式,自动以管理员身份登录后重置密码。每个方法都提供了详细步骤,提醒用户在操作前备份重要数据。