# 更新系统包信息
sudo apt-get update
# 安装fail2ban
sudo apt-get install fail2ban
# 启动fail2ban服务
sudo systemctl start fail2ban
# 设置fail2ban开机自启
sudo systemctl enable fail2ban
# 查看fail2ban状态
sudo systemctl status fail2ban
# 查看fail2ban配置文件的路径
sudo find / -name "fail2ban.conf"
# 查看fail2ban的日志文件
sudo cat /var/log/fail2ban.log