Skip to content

Instantly share code, notes, and snippets.

@Suzhou65
Last active September 14, 2020 11:51
Show Gist options
  • Save Suzhou65/5e0094956efa7be6e7e7da6939f44764 to your computer and use it in GitHub Desktop.
Save Suzhou65/5e0094956efa7be6e7e7da6939f44764 to your computer and use it in GitHub Desktop.
Ubuntu 14.04 install fail2ban

Install fail2ban

sudo apt-get update
sudo apt-get install fail2ban -y

Backup fail2ban configuration

sudo service fail2ban stop
sudo cp /etc/fail2ban/jail.conf /etc/fail2ban/jail.local

Editing fail2ban configuration

sudo cd /etc/fail2ban/
sudo vim jail.conf

Editing following configuration

bantime = 600
maxretry = 3

[sshd]
enabled = true
port    = ssh
logpath = %(sshd_log)s

Start fail2ban service

sudo /etc/init.d/fail2ban start
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment