带有 pam_tally2 和 6 个 ssh 密码提示的密码策略

带有 pam_tally2 和 6 个 ssh 密码提示的密码策略

我正在尝试在嵌入式 Linux 发行版上配置密码策略。

我希望在 3 次登录尝试失败后有 30 秒的冷却时间。

因此,我在 common-auth 文件中添加了最后一行,

auth       required     pam_tally2.so deny=3 unlock_time=30 even_deny_root

为了执行它

#
# /etc/pam.d/common-auth - authentication settings common to all services
#
# This file is included from other service-specific PAM config files,
# and should contain a list of the authentication modules that define
# the central authentication scheme for use on the system
# (e.g., /etc/shadow, LDAP, Kerberos, etc.).  The default is to use the
# traditional Unix authentication mechanisms.

# here are the per-package modules (the "Primary" block)
auth    [success=1 default=ignore]      pam_unix.so nullok_secure
# here's the fallback if no module succeeds
auth    requisite                       pam_deny.so
# prime the stack with a positive return value if there isn't one already;
# this avoids us returning an error just because nothing sets a success code
# since the modules above will each just jump around
auth    required                        pam_permit.so
# and here are more per-package modules (the "Additional" block)
auth       required     pam_tally2.so deny=3 unlock_time=30 even_deny_root

但是当我尝试运行 ssh 并且登录失败时,密码策略的这一部分永远不会被强制执行。事实上,当尝试登录时,会显示 6 个(而不是 3 个)登录提示,因此我认为登录中涉及其他模块,这些模块会干扰 common-auth 文件

相关内容