成长日记

成长日记

1panel无法启动fail2ban解决方案

2024-06-09
1panel无法启动fail2ban解决方案

在1panel中安装启用fail2ban时发现根本无法启动!毫无道理的启动后没反应,查看日志如下:

Jun  09  20:48:33 server.example.com systemd[1]: Starting fail2ban.service - Fail2Ban Service... 
Jun  09  20:48:33 server.example.com systemd[1]: Started fail2ban.service - Fail2Ban Service. 
Jun  09  20:48:33 server.example.com fail2ban-server[28319]: 2024-06-09 20:48:33,412 fail2ban.configreader [28319]: WARNING 'allowipv6' not defined in 'Definition'. 
Jun  09  20:48:33 server.example.com fail2ban-server[28319]: 2024-06-09 20:48:33,449 fail2ban [28319]: ERROR No module named 'asynchat' 
Jun  09  20:48:33 server.example.com systemd[1]: fail2ban.service: Main process exited, code=exited, status=255/EXCEPTION 
Jun  09  20:48:33 server.example.com systemd[1]: fail2ban.service: Failed with result 'exit-code'.

原来是日前我千辛万苦升级ubuntu24.04的锅!!!

解决方法:

  • 安装pip

sudo apt install python3-pip
  • 安装pyasynchat

sudo python3 -m pip install pyasynchat --break-system-packages
  • 启动fail2ban

systemctl start fail2ban