Linux

Ubuntu linux 密碼錯誤需要更長的時間

  • May 31, 2009

當我使用正確的密碼登錄到我的 Ubuntu 8.10 機器時,系統幾乎會立即發現密碼正確並讓我登錄。但是,如果我提供的密碼不正確,則需要更長的時間才能確定密碼不正確並且向我顯示登錄螢幕。

為什麼是這樣?在這兩種情況下不應該花費相同的時間嗎?

  • 謝謝

這是一項安全功能,可以減慢試圖猜測您密碼的人的速度。Ubuntu 需要相同的時間來查看它是否正確,但它會等待幾秒鐘,然後再讓您重試。

正如 Dentrasi 所解釋的 - 這是為了讓攻擊者更難對密碼儲存進行暴力攻擊。在幾乎所有情況下,您都不要更改此行為。

如果您有充分的理由(我想不出),您可以通過/etc/login.defs - 請參閱**login.defs(5)**手冊頁來修改它。

FAIL_DELAY (number)
 Delay in seconds before being allowed another attempt after a login failure.

嗯…在手冊頁的末尾…

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

引用自:https://serverfault.com/questions/16232