Ubuntu linux 需要更长的时间来处理错误的密码

Par*_*rag 6 linux ubuntu login time pam

当我使用正确的密码登录我的 Ubuntu 8.10 盒子时,系统几乎立即确定密码正确并让我登录。但是,如果我提供了错误的密码,则需要更长的时间才能确定密码不正确并且向我展示登录屏幕。

为什么是这样?在这两种情况下,不应该花费相同的时间吗?

- 谢谢

Den*_*asi 20

这是一项安全功能,可以减缓试图猜测您密码的人的速度。Ubuntu 需要相同的时间来查看它是否正确,但是它会等待几秒钟,然后让您再次尝试。


Xer*_*xes 15

正如 Dentrasi 所解释的那样 - 这是为了让攻击者更难对密码存储进行暴力攻击。在几乎所有情况下,您都不会改变这种行为。

如果您有充分的理由(我想不出),您可以通过/etc/login.defs - 请参阅login.defs(5)手册页对其进行修改。

FAIL_DELAY (number)
  Delay in seconds before being allowed another attempt after a login failure.
Run Code Online (Sandbox Code Playgroud)

嗯...在联机帮助页的末尾...

Much of the functionality that used to be provided by the shadow password suite
is now handled by PAM. Thus, /etc/login.defs is no longer used by passwd(1), or
less used by login(1), and su(1). Please refer to the corresponding PAM
configuration files instead.
Run Code Online (Sandbox Code Playgroud)

相应的 PAM 条目代替...

# Enforce a minimal delay in case of failure (in microseconds).
# (Replaces the `FAIL_DELAY' setting from login.defs)
# Note that other modules may require another minimal delay. (for example,
# to disable any delay, you should add the nodelay option to pam_unix)
auth       optional   pam_faildelay.so  delay=3000000
Run Code Online (Sandbox Code Playgroud)