歡迎您光臨本站 註冊首頁

伺服器被人用字典暴力破解,請問怎麼能限制登錄次數?謝謝!

大家好,
我管理的一台伺服器,最近總被人用字典暴力破解的方式用ssh猜測用戶名及密碼。感覺怕怕。

我是centos linux,請問怎樣配置可以讓用戶在ssh登錄時密碼錯5次,就鎖定此ip 24內不能再次ssh登錄呢?
《解決方案》

可插拔認證模塊PAM中的pam_tally模塊專職干此事。具體情況去看一下man pam_tally吧。
《解決方案》

最根本的方法還是用密鑰認證,做起來也不難。樓主考慮下吧。
《解決方案》

1)改port
2)禁root登陸
3)刪除無用用戶
4)denghosts  制定嘗試次數   鎖定時間

建議密鑰
《解決方案》

Another approach that is more generic (can be used with any port/service) is to use the IPT_RECENT module that comes with netfilter:

For example I have the following lines in my iptables config:

iptables -N SSH_CHECK
iptables -A INPUT -p tcp --dport 22 -m state --state NEW -j SSH_CHECK
iptables -A SSH_CHECK -m state --state NEW -m recent --set --name SSH
iptables -A SSH_CHECK -m state --state NEW -m recent --update --seconds 60 --hitcount 4 --name SSH
iptables -A SSH_CHECK -m state --state NEW -m recent --rcheck --seconds 60 --hitcount 4 --name SSH -j DROP

which basically kick-bans the source IP for 60 seconds if more than 3 connections are attempted in a 60 second limit.

I've found this to be 100% effective.
《解決方案》

我認為樓上的方法 + 公鑰認證是最佳方案

[火星人 ] 伺服器被人用字典暴力破解,請問怎麼能限制登錄次數?謝謝!已經有489次圍觀

http://coctec.com/docs/service/show-post-31728.html