File 2 ban
Установка
sudo apt install fail2bansudo systemctl start fail2ban
sudo systemctl enable fail2banНастройка
[DEFAULT]
ignorecommand =
bantime = 10m
findtime = 10m
maxretry = 5Last 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
sudo systemctl daemon-reload
journalctl -b -u fail2ban# Проверяем, существует ли файл
find / -name "sshd_log"
# если нет, создаем файл сами
touch /var/log/sshd_log
#открываем file2ban чтобы прописать путь к логам
sudo nano /etc/fail2ban/jail.conf
# Найдем блок [sshd]
# Удаляем строчку
logpath = %(sshd_log)s
# Вставляем строчку, чтобы прописать путь
logpath = /var/log/sshd_log
# Перезагружаем file2ban
sudo systemctl daemon-reload
sudo systemctl reload fail2ban
# Проверяем
sudo systemctl status fail2ban
journalctl -b -u fail2ban