Skip to content

Instantly share code, notes, and snippets.

@cyrex562
Created May 16, 2019 16:08
Show Gist options
  • Select an option

  • Save cyrex562/ba8a80ba00de1cd0c15d93ec4c82c63d to your computer and use it in GitHub Desktop.

Select an option

Save cyrex562/ba8a80ba00de1cd0c15d93ec4c82c63d to your computer and use it in GitHub Desktop.
setup fail2ban on linux hosts

Setup Fail2Ban

Ubuntu 18.04

  1. Install Fail2Ban: sudo apt install -y fail2ban```

  2. Create /etc/fail2ban/jail.d/sshd.conf:

    [sshd]
    enabled = true
    port = 22
    filter = sshd
    logpath = /var/log/auth.log
    maxretry = 3
  3. Create /etc/fail2ban/jail.d/openvpn.conf:

    [openvpn]
    enabled  = true
    port     = 1194
    protocol = udp
    filter   = openvpn
    logpath  = /var/log/openvpn.log
    maxretry = 3
  4. Restart fail2ban sudo systemctl restart fail2ban

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment