安装

sudo yum install fail2ban
sudo apt-get
<!--more-->
install fail2ban 

服务状态

systemctl status fail2ban
systemctl restart fail2ban

查看敏感日志:

sudo tail -f /var/log/fail2ban.log

检查 fail2ban 状态

fail2ban-client status
fail2ban-client status sshd

解锁 ip

sudo fail2ban-client set sshd unbanip 192.168.1.8

问题记录

Failed during configuration: Have not found any log file for sshd jail #3567

From other point of view it is a configuration issue and can be surely simply fixed using:

- echo -e "[sshd]\nenabled=true" | sudo tee /etc/fail2ban/jail.local
+ echo -e "[sshd]\nbackend=systemd\nenabled=true" | sudo tee /etc/fail2ban/jail.local

With other words:

  $ sudo cat /etc/fail2ban/jail.local 
  [sshd]
+ backend=systemd
  enabled = true

References

最后修改:2024 年 09 月 05 日
如果觉得我的文章对你有用,请随意赞赏