Install and Configure Fail2Ban on Ubuntu 14.04

Install Fail2Ban

sudo apt-get -y install fail2ban

Configure Fail2Ban

  • Create a Fail2Ban local jail configuration file.
    sudo nano /etc/fail2ban/jail.local
    • Add
      [DEFAULT]
      ignoreip = 127.0.0.1 {IP_PUBLIC} {IP_PRIVATE}
      destemail = {ADMIN_EMAIL}
      mta = sendmail

      [ssh]
      port = {SSH_PORT}

      [ssh-ddos]
      enabled = true
      port = {SSH_PORT}

      [apache]
      enabled = true

      [apache-noscript]
      enabled = true

      [apache-overflows]
      enabled = true
  • Restart the Fail2Ban service
    sudo service fail2ban restart

Open Source Software:

Operating System: