File 2 ban
Installation
sudo apt install fail2bansudo systemctl start fail2ban
sudo systemctl enable fail2banSetting
[DEFAULT]
ignorecommand =
bantime = 10m
findtime = 10m
maxretry = 5Debugging
Last updated
sudo apt install fail2bansudo systemctl start fail2ban
sudo systemctl enable fail2ban[DEFAULT]
ignorecommand =
bantime = 10m
findtime = 10m
maxretry = 5Last updated
sudo nano /etc/fail2ban/jail.confsudo systemctl reload fail2ban
journalctl -b -u fail2ban# Checking if the file exists
find / -name "sshd_log"
# if not, then create the file by yourself
touch /var/log/sshd_log
# open file2ban to set the path to the logs
sudo nano /etc/fail2ban/jail.conf
# Find block [sshd]
# Delete a line to write a different path
logpath = %(sshd_log)s
# Insert a line to write the path
logpath = /var/log/sshd_log
# Check the status of fail2ban and restart
sudo systemctl status fail2ban
sudo systemctl reload fail2ban