系统之家 - 系统光盘下载网站!

当前位置:系统之家 > 系统教程 > Linux安装使用fail2ban

Linux安装使用fail2ban的方法

时间:2015-04-15 11:17:45 作者:qipeng 来源:系统之家 1. 扫描二维码随时看资讯 2. 请使用手机浏览器访问: https://m.xitongzhijia.net/xtjc/20150415/45343.html 手机查看 评论

  Fail2ban是一款非常使用的软件,它能够监控系统日志,能够有效的防止ssh被暴力破解,下面小编将针对Fail2ban在Linux下的安装和使用给大家做个介绍,一起来了解下吧。

 Linux安装使用fail2ban的方法

  通过iptables, tcp-wrapper, shorewall等方式阻止此IP的访问。

  需要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下的文件指定满足条件时执行的一些动作,比如使用iptables禁止ip访问。

标签 fail2ban

发表评论

0

没有更多评论了

评论就这些咯,让大家也知道你的独特见解

立即评论

以上留言仅代表用户个人观点,不代表系统之家立场

其他版本软件

热门教程

人气教程排行

Linux系统推荐

官方交流群 软件收录