Skip to content

Instantly share code, notes, and snippets.

@jhowbhz
Last active May 17, 2024 04:44
Show Gist options
  • Save jhowbhz/be0ba8b5d2ff439e5e737f2d36e22787 to your computer and use it in GitHub Desktop.
Save jhowbhz/be0ba8b5d2ff439e5e737f2d36e22787 to your computer and use it in GitHub Desktop.
Install fail2Ban
# 1. Instalar Fail2Ban
sudo apt install fail2ban
# 2. Configurar Fail2Ban
sudo cp /etc/fail2ban/jail.conf /etc/fail2ban/jail.local
# 2.1 Configure os parametros de acordo com a sua necesidade
[DEFAULT]
bantime = 10m
findtime = 10m
maxretry = 5
---------------
[sshd]
enabled = true
port = ssh
logpath = /var/log/auth.log
maxretry = 5
# Ativar serviço
sudo systemctl start fail2ban
# Ativar automaticamente
sudo systemctl enable fail2ban
# Verificar status
sudo fail2ban-client status
# 3. Configuração de Email (Opcional)
destemail = your-email@example.com
sender = fail2ban@example.com
mta = sendmail
action = %(action_mwl)s
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment