92 字
1 分钟
fail2ban安装
安装
sudo aptitude install fail2ban -y编辑配置文件
配置文件路径,/etc/fail2ban。
配置文件内容,/etc/fail2ban/jail.local:
[sshd]enabled = trueport = sshlogpath = %(sshd_log)smaxretry = 5 # 允许连续失败次数bantime = 600 # 封禁时间,秒,600=10分钟,建议生产环境设置长一点如1h、12h甚至永久findtime = 600 # 统计多长时间内的尝试,秒 fail2ban安装
https://blog.echopath.one/posts/fail2ban安装/