大网数据广告活动
服务器运维问答

ufw enable is not working, and it crashes my OS

· 52CE 我爱测

Where the problems started: First i tried to install fail2ban from the ISPmanager UI, the fail2ban was installed but i got a error related to the package coremanager-pkg-fail2ban , and the fail2ban was not working so i tried to u…

问题原文

原帖链接 · mario · CC BY-SA 4.0

Where the problems started:

First i tried to install fail2ban from the ISPmanager UI, the fail2ban was installed but i got a error related to the package coremanager-pkg-fail2ban, and the fail2ban was not working so i tried to uninstalled it using the ISPmanager UI and using the command apt-get remove coremanager-pkg-fail2ban but it said that there's no package with this name, and this error still remains: error

I did apt-get remove fail2ban and apt-get purge auto-remove fail2ban after this i reinstalled fail2ban using the command apt-get install fail2ban and i was getting this error: failed to validate path /var/run/fail2ban too many levels of symbolic links. I searched a bit and i found this answear https://serverfault.com/a/949286/521284, what did solved my problem with the fail2ban, and now fail2ban is running on my server:

root# systemctl status fail2ban 
fail2ban.service - Fail2Ban Service
    Loaded: loaded (/lib/systemd/system/fail2ban.service; enabled; vendor preset: enabled)
    Active: active (running) since Mon 2019-04-29 15:44:15 EDT; 18min ago
    Docs: man:fail2ban(1)
    Process: 293 ExecStart=/usr/bin/fail2ban-client -x start (code=exited, status=0/SUCCESS)
    Main PID: 411 (fail2ban-server)
    CGroup: /system.slice/fail2ban.service
           └─411 /usr/bin/python3 /usr/bin/fail2ban-server -s /var/run/fail2ban/fail2ban.sock -p /var/run/fail2ban/fail2ban.pid -x -b

Apr 29 15:44:13 testdomain systemd[1]: Starting Fail2Ban Service...
Apr 29 15:44:14 testdomain fail2ban-client[293]: 2019-04-29 15:44:14,540 fail2ban.server [374]: INFO Starting Fail2ban v0.9.3
Apr 29 15:44:14 testdomain fail2ban-client[293]: 2019-04-29 15:44:14,541 fail2ban.server [374]: INFO Starting in daemon mode
Apr 29 15:44:15 testdomain systemd[1]: Started Fail2Ban Service.

But when i do ufw enable i get this error and my OS crashes and i need to restart the OS:

root# ufw enable
ERROR: problem running ufw-init
modprobe: ERROR: ../libkmod/libkmod.c:514 lookup_builtin_file() could not open builtin file '/lib/modules/2.6.32-042stab127.2/modules.builtin.bin'
modprobe: FATAL: Module nf_conntrack_ftp not found in directory /lib/modules/2.6.32-042stab127.2
modprobe: ERROR: ../libkmod/libkmod.c:514 lookup_builtin_file() could not open builtin file '/lib/modules/2.6.32-042stab127.2/modules.builtin.bin'
modprobe: FATAL: Module nf_nat_ftp not found in directory /lib/modules/2.6.32-042stab127.2
modprobe: ERROR: ../libkmod/libkmod.c:514 lookup_builtin_file() could not open builtin file '/lib/modules/2.6.32-042stab127.2/modules.builtin.bin'
modprobe: FATAL: Module nf_conntrack_netbios_ns not found in directory /lib/modules/2.6.32-042stab127.2
iptables-restore: line 4 failed
iptables-restore: line 77 failed
iptables-restore: line 30 failed
ip6tables-restore: line 4 failed
ip6tables-restore: line 138 failed
ip6tables-restore: line 30 failed
sysctl: permission denied on key 'net.ipv4.tcp_sack'

Problem running '/etc/ufw/before.rules'
Problem running '/etc/ufw/user.rules'
Problem running '/etc/ufw/before6.rules'
Problem running '/etc/ufw/user6.rules'

I'm tring to solve this problem with the ufw, could someone help? My ubuntu version is 16.04. And i'm using Apache2

已采纳解答

原帖链接 · Michael Hampton · CC BY-SA 4.0

Your "virtual machine" is not a true virtual machine, but an OpenVZ "container" (and not a modern container, but an ancient pre-LXC container). OpenVZ does not permit containers to load kernel modules, which you have to do in order to use the firewall features you are trying to use. Further, the 2.6.32 based kernel which they supply is too old to use many modern Linux features anyway. It was released in 2009!

To solve the problem, get a new VPS from another provider, which does not use OpenVZ or its commercial variant Virtuozzo.

摘自公开归档,保留原文语言,版式经整理,外部媒体与邮箱地址已移除。

资料来源与适用范围

资料来源
Server Fault
适用范围
以原帖系统、软件版本与发布日期为准(2019-04-29)
内容语言
中文;命令、路径和错误标识保留技术原文
本地收录日期
2026-11-15
授权说明
CC BY-SA 4.0

正文与所需资源由本站本地存储。查看来源及更新记录 ↗

请按适用版本和实际日志确认原因;本站没有对每一种系统或设备逐项执行文中的操作。