熱搜:win11繞過(guò)硬件限制安裝 一鍵重裝Win10系統(tǒng) 最干凈的u盤啟動(dòng)盤 真正純凈版的win7系統(tǒng)
時(shí)間:2015-04-15 11:17:45 作者:qipeng 來(lái)源:系統(tǒng)之家 1. 掃描二維碼隨時(shí)看資訊 2. 請(qǐng)使用手機(jī)瀏覽器訪問(wèn): https://m.xitongzhijia.net/xtjc/20150415/45343.html 手機(jī)查看 評(píng)論 反饋
Fail2ban是一款非常使用的軟件,它能夠監(jiān)控系統(tǒng)日志,能夠有效的防止ssh被暴力破解,下面小編將針對(duì)Fail2ban在Linux下的安裝和使用給大家做個(gè)介紹,一起來(lái)了解下吧。
通過(guò)iptables, tcp-wrapper, shorewall等方式阻止此IP的訪問(wèn)。
需要Pytion支持
python安裝
python安裝方法:
cd /tmp
wget https://python.org/ftp/python/2.7.3/Python-2.7.3.tgz
tar xzf Python-2.7.3.tgz
cd Python-2.7.3
。/configure
make && make install
rm -rf /usr/bin/python
ln -s /tmp/Python-2.7.3/python /usr/bin/
fail2ban安裝
cd /tmp
wget https://github.com/downloads/fail2ban/fail2ban/fail2ban_0.8.6.orig.tar.gz
tar xzf fail2ban_0.8.6.orig.tar.gz
cd fail2ban-fail2ban-a20d1f8/
。/setup.py install
cp files/RedHat-initd /etc/init.d/fail2ban
chmod 755 /etc/init.d/fail2ban
配置fail2ban日志輪循:
vi /etc/logrotate.d/fail2ban
寫入:
/var/log/fail2ban.log {
weekly
rotate 7
missingok
compress
postrotate
/etc/init.d/fail2ban restart 1》/dev/null || true
endscript
}
fail2ban使用方法
配置文件:
/etc/fail2ban/
├── action.d
│ ├── dummy.conf
│ ├── hostsdeny.conf
│ ├── iptables.conf
│ ├── mail-whois.conf
│ ├── mail.conf
│ └── shorewall.conf
├── fail2ban.conf
├── fail2ban.local
├── filter.d
│ ├── apache-auth.conf
│ ├── apache-noscript.conf
│ ├── couriersmtp.conf
│ ├── postfix.conf
│ ├── proftpd.conf
│ ├── qmail.conf
│ ├── sasl.conf
│ ├── sshd.conf
│ └── vsftpd.conf
├── jail.conf
└── jail.local
目錄action.d下的文件指定滿足條件時(shí)執(zhí)行的一些動(dòng)作,比如使用iptables禁止ip訪問(wèn)。
發(fā)表評(píng)論
共0條
評(píng)論就這些咯,讓大家也知道你的獨(dú)特見(jiàn)解
立即評(píng)論以上留言僅代表用戶個(gè)人觀點(diǎn),不代表系統(tǒng)之家立場(chǎng)