防止Proxmox 8006端口被黑客攻击爆破
可以开启Fail2ban来防御
根据官网的wiki教程
这里简单提供一下我的配置文件和操作步骤
apt update
apt install fail2ban
cp /etc/fail2ban/jail.conf /etc/fail2ban/jail.local
nano /etc/fail2ban/jail.local
[sshd]
# 启用 SSH 保护
enabled = true
# SSH 访问端口
port = ssh
# 日志后端
backend = systemd
# 最大失败次数
maxretry = 5
# 查找时间(10分钟)
findtime = 10m
# 封禁时长(1小时)
bantime = 1h
#---------------------------------------------
[proxmox]
# 启用 Proxmox 保护
enabled = true
# Proxmox 访问端口
port = https,http,8006
# 使用自定义的 Proxmox 过滤器
filter = proxmox
# 日志后端
backend = systemd
# 最大失败次数
maxretry = 3
# 查找时间(2天)
findtime = 2d
# 封禁时长(1小时)
bantime = 1h
nano /etc/fail2ban/filter.d/proxmox.conf
[Definition]
failregex = pvedaemon\[.*authentication failure; rhost=<HOST> user=.* msg=.*
ignoreregex =
journalmatch = _SYSTEMD_UNIT=pvedaemon.service
systemctl restart fail2ban
systemctl status fail2ban
fail2ban-client status sshd
fail2ban-client status proxmox
- 查看部分运行日志是否有错误可以
journalctl -u fail2ban