在线求解一个Fail2ban问题
本帖最后由 Jike 于 2024-11-16 11:25 编辑Proxmox VE中快速设置Fail2ban
[*]安装Fail2ban
[*]在Proxmox VE主机上作为root执行以下命令:
[*]
[*]apt upd删ate
[*]apt install fail2ban
[*]配置基础设置
[*]建议使用/etc/fail2ban/jail.local文件,其设置优先于jail.conf。使用以下命令复制模板:
[*]
[*]cp /etc/fail2ban/jail.conf /etc/fail2b删an/jail.local
[*]使用systemd后端设置Jail
[*]在/etc/fail2ban/jail.local文件末尾添加:
[*]
[*]
[*]enabled = true
[*]port = https,http,8006
[*]filter = proxmox
[*]backend = systemd
[*]maxretry = 3
[*]findtime = 2d
[*]bantime = 1h
[*]配置过滤器
[*]创建文件/etc/fail2ban/filter.d/proxmox.conf并添加:
[*]
[*]
[*]failregex = pvedaemon\[.*authentication failure; rhost= user=.* msg=.*
[*]ignoreregex =
[*]journalmatch = _SYSTEMD_UNIT=pvedaemon.service
[*]启用配置
[*]使用以下命令重启服务:
[*]
[*]systemctl restart fail2ban
[*]复制代码
然后root@cpee:/etc/fail2ban# sudo fail2ban-client status
2024-11-16 11:21:52,361 fail2ban : ERROR Failed to access socket path: /var/run/fail2删ban/fail2ban.sock. Is fail2ban running?
这是什么问题啊 兄弟们求解(不加删发不了帖)
#加sudo,妥妥的ctrl-c ctrl-v..
写配置文件不要写那么花,写精简点,只包括基本的,包括local和filter都一样
你配置文件没贴全
我昨天也遇到了。是因为我指定了日志目录。结果systemctl status rsyslog这个服务没装。。。
icon 发表于 2024-11-16 11:31
#加sudo,妥妥的ctrl-c ctrl-v..
写配置文件不要写那么花,写精简点,只包括基本的,包括local和filter都一 ...
还是错误啊 大佬
root@cpdd:/etc# sudo systemctl status fail2ban
× fail2ban.service - Fail2Ban Service
Loaded: loaded (/lib/systemd/system/fail2ban.service; enabled; preset: enabled)
Active: failed (Result: exit-code) since Sat 2024-11-16 11:43:39 CST; 7s ago
Duration: 88ms
Docs: man:fail2ban(1)
Process: 199955 ExecStart=/usr/bin/fail2ban-server -xf start (code=exited, status=255/EXCEPTION)
Main PID: 199955 (code=exited, status=255/EXCEPTION)
CPU: 85ms
Nov 16 11:43:39 systemd: Started fail2ban.service - Fail2Ban Service.
Nov 16 11:43:39fail2ban-server: 2024-11-16 11:43:39,341 fail2ban.configreader : WARNING 'all>
Nov 16 11:43:39 fail2ban-server: 2024-11-16 11:43:39,352 fail2ban : ERROR Fail>
Nov 16 11:43:39fail2ban-server: 2024-11-16 11:43:39,355 fail2ban : ERROR Asyn>
Nov 16 11:43:39systemd: fail2ban.service: Main process exited, code=exited, status=255/EXCEPTION
Nov 16 11:43:39 systemd: fail2ban.service: Failed with result 'exit-code'.
Jike 发表于 2024-11-16 11:44
还是错误啊 大佬
root@cpdd:/etc# sudo systemctl status fail2ban
你把屏幕滚到右边屏,看看完整的错误信息。
页:
[1]