
pam_cracklib
Password security is important subject in IT. We call it password but actually it is a key to enter systems. Making authentication password-less by using key-based authentication is more secure but it is not always possible. So for the password-based authentication password strength is important.
密码安全性是IT中的重要主题。 我们称它为密码,但实际上它是进入系统的关键。 通过使用基于密钥的身份验证使身份验证免密码,这是更安全的方法,但并非总是可能的。 因此对于基于密码的身份验证,密码强度很重要。
我们如何使密码更安全 (How Can We Make Passwords Strong)
Actually making passwords strong is easy. The important thing is making this a default behavior. Just typing more 5 characters will make our systems like a castle.
实际上使密码更容易。 重要的是使它成为默认行为。 只需输入5个以上的字符,我们的系统就会像城堡一样。
- At least use 14 characters 至少使用14个字符
- Use easy to remember the expression使用容易记住的表达
- Use . , ; ” ! more than 3 times 用 。 ,; !! 3次以上
安装Cracklib(Install Cracklib)
Ubuntu,Debian,Kali,Mint: (Ubuntu, Debian, Kali, Mint:)
We will install cracklib-runtime
package with the following command for Ubuntu, Debian, Kali, and Mint.
我们将使用以下命令为Ubuntu ,Debian,Kali和Mint安装cracklib-runtime
软件包。
$ sudo apt-get install cracklib-runtime -y
Fedora,CentOS,RedHat: (Fedora, CentOS, RedHat:)
cracklib
is the package we will install in Fedora, CentOS, RedHat.
cracklib
是我们将在Fedora,CentOS,RedHat中安装的软件包。
$ yum install cracklib -y
检查给定的密码 (Check Given Password)
There are different tools provided by cracklib
but the most useful and important one is cracklib-check
command. We will provide the password we want to check to the cracklib-check
command as standard input.
cracklib
提供了多种工具,但最有用和最重要的工具是cracklib-check
命令。 我们会将要检查的密码作为标准输入提供给cracklib-check
命令。
简单/系统 (Simplistic/systematic)
We will check the password 123456
which is insecure as we know.
我们将检查密码123456
,该密码是我们所知道的不安全的。
$echo "123456" | cracklib-check

太短(Too Short)
it is too short
message means we need to use more characters than given password.
消息it is too short
意味着我们需要使用比给定密码更多的字符。
$ echo "admin" | cracklib-check

确定或密码安全(Ok or Password Is Secure)
If the given password is secure the OK
message is printed to the screen.
如果给定的密码是安全的,则将OK
消息打印到屏幕上。
$ echo "3dAmI12." | cracklib-check

从文件检查多个密码(Check Multiple Password From File)
If checking passwords one by one is long process we can check password with a single run by providing them from a file. In this example we will write all passwords into file named pass
and redirect to the cracklib-check
command like below.
如果一个接一个地检查密码是一个漫长的过程,我们可以通过从文件中提供一次来一次检查密码。 在此示例中,我们将所有密码写入名为pass
文件中,并重定向到如下所示的cracklib-check
命令。
$ cat pass | cracklib-check

如何使用Cracklib在Linux中检查密码强度? 信息移植 (How To Check Password Strength In Linux With Cracklib? Infografic)

翻译自: https://www.poftut.com/check-password-strength-linux-cracklib/
pam_cracklib