FreeBSD安裝sshguard-ipfw

請先完成ipfw設置

cd /usr/ports/security/sshguard-ipfw;make install clean

在/etc/syslog.conf 中

#auth.info;authpriv.info |exec /usr/local/sbin/sshguard

註解去掉

也可以自由設定鎖定時間

例如:

auth.info;authpriv.info |exec /usr/local/sbin/sshguard -a 5 -p 7200 -s 3600

(a:失敗多少次 p:被擋多久(秒) s:多少秒忘記攻擊)

最後/etc/rc.d/syslogd restart

接著你可以tail -f /var/log/auth.log,然後用putty連線,密碼請故意打錯四次,就會出現:

Jan 26 13:31:05 earth sshguard[40059]: Blocking 210.71.11.116:4 for >420secs: 4 failures over 2 seconds.

解除鎖定:

使用另一個IP登入

ipfw show

ipfw delete xxxxx

评论

此博客中的热门博文

FreeBSD安装Pure-FTPd及user manager for PureFTPd

debian lighttpd php ssl

解决nginx出现File not found的问题