Jan Walraven
DevOps



Categories:
  • Arduino (2)
  • CSS (3)
  • Docker (11)
  • ESXi (1)
  • Git (4)
  • Google Cloud (3)
  • Javascript (6)
  • Kubernetes (4)
  • Linux (36)
  • Mac (7)
  • Magento (4)
  • Mysql (14)
  • PHP (9)
  • Zend framework 2 (9)
  • Posted on March 6, 2017

    Installation

    $ sudo yum install -y epel-release
    $ sudo yum install -y fail2ban fail2ban-systemd
    $ sudo yum update -y selinux-policy*

    Configure Fail2Ban

    Edit the file /etc/fail2ban/jail.d/sshd.local

    [sshd]
    enabled = true
    port = ssh
    #Disable this line
    #action = firewallcmd-ipset
    logpath = %(sshd_log)s
    maxretry = 5
    bantime = 86400
    

    Edit /etc/fail2ban/jail.conf

    ignoreip = 127.0.0.1/8 YOURIP

    Enable and start Fail2Ban

    $ sudo systemctl enable fail2ban
    $ sudo systemctl start fail2ban