当我使用正确的密码login到Ubuntu 8.10中时,系统几乎可以即时计算出密码是否正确并将其login。但是,如果提供的密码不正确,则需要更长时间才能确定密码不正确,向我显示login屏幕。
为什么是这样? 两种情况下都不应该花费相同的时间?
– 谢谢
这是一个安全function,可以减缓试图猜测密码的人的速度。 Ubuntu需要花费相同的时间来查看是否正确,但是等待几秒钟后再重新尝试一次。
正如Dentrasi解释的 – 这是为了让攻击者更难对密码存储区进行暴力攻击。 在几乎所有情况下,你都不要改变这种行为。
如果你有一个很好的理由(我想不出来),你可以通过/etc/login.defs来修改它 – 请参阅login.defs(5)手册页。
FAIL_DELAY (number) Delay in seconds before being allowed another attempt after a login failure.
嗯…在manpage结尾处…
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.
相应的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
现在,pam.d负责FAIL_DELAY。 把它添加到/etc/pam.d/common-auth(用于Debian / Ubuntu):
auth需要pam_unix.so nodelay
Fedora / Redhat:添加到/etc/pam.d/system-auth:
auth required /lib/security/$ISA/pam_unix.so nodelay
$ ISA只是用来select32位和64位模块,并已被定义。
说到PAM,如果计算机设置为LDAP或Kerberos或类似的networkingauthentication,当本地login失败时,它将尝试使用提供的凭证进行远程login。 (不涉及这个问题,但。