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月前
|
Ubuntu 物联网 Linux
从零安装一个Linux操作系统几种方法,以Ubuntu18.04为例
一切就绪后,我们就可以安装操作系统了。当系统通过优盘引导起来之后,我们就可以看到跟虚拟机中一样的安装向导了。之后,大家按照虚拟机中的顺序安装即可。 好了,今天主要介绍了Ubuntu Server版操作系统的安装过程,关于如何使用该操作系统,及操作系统更深层的原理,还请关注本号及相关圈子。
|
17天前
|
缓存 监控 Linux
Linux系统清理缓存(buff/cache)的有效方法。
总结而言,在大多数情形下你不必担心Linux中buffer与cache占用过多内存在影响到其他程序运行;因为当程序请求更多内存在没有足够可用资源时,Linux会自行调整其占有量。只有当你明确知道当前环境与需求并希望立即回收这部分资源给即将运行重负载任务之前才考虑上述方法去主动干预。
260 10
|
2月前
|
监控 安全 Linux
在Linux中设定账户密码的安全性策略
这些操作应该由有经验的系统管理员进行,因为不当的配置可能导致无法预期的安全问题或者系统访问问题。此外,提升安全性的同时,也需要考虑到用户的便利性,避免设置过于严苛的政策导致用户体验不佳。通常,强密码策略配合两因素认证(2FA)将大大加强账户的安全性。
137 13
|
1月前
|
Ubuntu Linux 图形学
推广与体验Ubuntu Linux的便捷方法
如果你的朋友或家人对尝试Linux感兴趣,但希望在安装之前先体验一下,你可以分享以下链接给他们:Ubuntu在线导览。通过这个链接,他们可以在任何地方轻松体验Ubuntu,无需安装即可深入了解这个流行的操作系统。
|
1月前
|
XML 缓存 Linux
在Linux环境下解决Visual Studio Code字体显示异常和字体替换方法。
解决Linux下VS Code字体显示异常,需要对Linux字体渲染机制有所理解,并对VS Code的配置选项进行合理设置。替换字体时则要通过系统字体配置或VS Code设置来完成。通过上述方法,可以有效地解决字体显示问题,从而提升代码编辑的视觉体验。
130 0
|
3月前
|
运维 Ubuntu Linux
Linux重置root用户密码
本文详细介绍了Linux系统中root密码重置的核心技能,涵盖主流发行版如RHEL、CentOS、Debian、Ubuntu、Arch、openSUSE等的实操方法。内容包括通过GRUB引导编辑、单用户模式和Live CD救援三种方式重置密码的具体步骤,适配物理机、虚拟机及云服务器环境。文章分步解析了启动拦截、权限获取和密码重置三大阶段,并提供各发行版的实际操作代码示例,帮助管理员快速解决忘记root密码的问题。
|
4月前
|
NoSQL Linux 编译器
GDB符号表概念和在Linux下获取符号表的方法
通过掌握这些关于GDB符号表的知识,你可以更好地管理和理解你的程序,希望这些知识可以帮助你更有效地进行调试工作。
180 16
|
2月前
|
网络协议 Ubuntu Linux
Wireguard in Linux的安装方法
本文介绍了如何在Ubuntu和Rocky Linux中安装配置WireGuard,并探讨了配置过程中可能出现的DNS泄露问题及解决方法,包括通过nmtui设置DNS及调整DNS优先级参数。
|
5月前
|
Linux Shell
Linux系统下快速批量创建和删除文件的方法
总的来说,使用shell脚本来批量处理文件是一种非常强大的工具,只要你愿意花时间学习和实践,你会发现它能大大提高你的工作效率。
268 19