Ubuntu16.04/18.04安装Fail2ban步骤

1,306次阅读
没有评论

# 如有必要安装系统更新
sudo apt-get update
sudo apt-get upgrade

# 安装 fail2ban 服务
sudo apt-get install -y fail2ban

# 启动服务,并设置开机自动启动
sudo systemctl start fail2ban
sudo systemctl enable fail2ban

sudo vi /etc/fail2ban/jail.local
#写入内容
[sshd]
enabled = true
port = 50022
filter = sshd
logpath = /var/log/auth.log
maxretry = 3

# 修改配置文件后重启服务
sudo systemctl restart fail2ban

# 取消被限制 ip
sudo fail2ban-client set sshd unbanip 被限制 ip

正文完
 0
评论(没有评论)
验证码