git clone git://github.com/fail2ban/fail2ban.git
cd fail2ban
python setup.py install
這樣就裝好了,然后進(jìn)入/etc/fail2ban,復(fù)制jail.conf到j(luò)ail.local,編輯jail.local制定各種規(guī)則。規(guī)則制定很簡(jiǎn)單的,只要打開相應(yīng)功能就行,比方我的ssh配置是:
[ssh-iptables]
enabled = true
filter = sshd
action = iptables[name=SSH, port=ssh, protocol=tcp]
sendmail-whois[name=SSH, dest=root@xxx.com, sender=root@xxx.com]
logpath = /var/log/secure
maxretry = 5
最后設(shè)置成系統(tǒng)自啟動(dòng),進(jìn)入fail2ban源代碼解壓目錄,我的是/root/fail2ban/files
cp redhat-initd /etc/init.d/fail2ban // 不同的系統(tǒng),源文件是不同的
chmod 755 /etc/init.d/fail2ban
cd /etc/init.d
chkconfig --add fail2ban
service fail2ban start
好了,雖然不能高枕無憂,但可以放心點(diǎn)了。還有密碼千萬不能太簡(jiǎn)單,不要讓人家?guī)状尉筒轮辛?img src="images/smilies/default/biggrin.gif" smilieid="3" border="0" alt="" />
歡迎光臨 WDlinux官方論壇 (http://fudaan.com/bbs/) | Powered by Discuz! 7.2 |