Last active
May 17, 2024 04:44
-
-
Save jhowbhz/be0ba8b5d2ff439e5e737f2d36e22787 to your computer and use it in GitHub Desktop.
Install fail2Ban
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# 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 = [email protected] | |
sender = [email protected] | |
mta = sendmail | |
action = %(action_mwl)s |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment