6.2. pam_cracklib-根据字典词检查密码

pam_cracklib.so [ ... ]

6.2.1. DESCRIPTION

可以将该模块插入给定应用程序的* password *堆栈中,以提供一些插件强度检查来检查密码。

该模块的作用是提示用户 Importing 密码,并根据系统词典和一组识别错误选择的规则来检查其强度。

第一个操作是提示 Importing 单个密码,检查其强度,然后,如果认为强度很高,则再次提示 Importing 密码(以验证第一次 Importing 的密码是否正确)。一切都很好,密码将传递给后续模块以作为新的身份验证令牌进行安装。

强度检查按以下方式进行:首先,调用Cracklib例程以检查密码是否属于字典;如果不是这种情况,则会进行另一组强度检查。这些检查是:

此模块不带参数,可以很好地用于标准的 unix 密码加密。使用 md5 加密时,密码可以超过 8 个字符,并且此模块的默认设置会使用户难以选择令人满意的新密码。值得注意的是,新密码所包含的字符数不得超过旧密码中字符数的 1/2,这一要求变得不平凡。例如,很难更改“快速的棕色狐狸跳过懒狗”形式的旧密码。此外,默认操作是允许密码长度最小为 5 个字符。对于 md5 系统,最好增加所需的最小密码长度。然后,可以为不同种类的字符提供更多的信用,但是接受新密码可以与旧密码共享大多数这些字符。

6.2.2. OPTIONS

(N <0)这是新密码必须满足的最小位数。

(N <0)这是新密码必须满足的最小大写字母数。

(N <0)这是新密码必须满足的最小小写字母数。

(N <0)这是新密码必须满足的最少其他字符数。

6.2.3. 提供的模块类型

仅提供password模块类型。

6.2.4. 返回值

6.2.5. EXAMPLES

对于使用此模块的示例,我们展示了如何将其与 pam_unix(8)的密码组件堆叠在一起

#
# These lines stack two password type modules. In this example the
# user is given 3 opportunities to enter a strong password. The
# "use_authtok" argument ensures that the pam_unix module does not
# prompt for a password, but instead uses the one provided by
# pam_cracklib.
#
passwd  password required       pam_cracklib.so retry=3
passwd  password required       pam_unix.so use_authtok

另一个示例(以/etc/pam.d/passwd格式)是您要使用 md5 密码加密的情况:

#%PAM-1.0
#
# These lines allow a md5 systems to support passwords of at least 14
# bytes with extra credit of 2 for digits and 2 for others the new
# password must have at least three bytes that are not present in the
# old password
#
password  required pam_cracklib.so \
               difok=3 minlen=15 dcredit= 2 ocredit=2
password  required pam_unix.so use_authtok nullok md5

如果您不想使用 Integration,这是另一个示例:

#%PAM-1.0
#
# These lines require the user to select a password with a minimum
# length of 8 and with at least 1 digit number, 1 upper case letter,
# and 1 other character
#
password  required pam_cracklib.so \
               dcredit=-1 ucredit=-1 ocredit=-1 lcredit=0 minlen=8
password  required pam_unix.so use_authtok nullok md5

6.2.6. AUTHOR

pam_cracklib 由 Cristian Gafton<gafton@redhat.com>编写

上一章 首页 下一章