On a fresh Ubuntu 16.04 LTS install after installing nginx, php, mysql I was trying to install ufw.
First, when I tried to allow Port 22/OpenSSH I came across an iptables error.
ERROR: initcaps
[Errno 2] iptables: Memory allocation problem.
After some research I tried the commands
iptables -F
iptables -X
and ran the command again. It now seemed to work.
Then i tried to run sudo nfw enable and I keep getting this error message unfortunately:
sudo ufw enable
Command may disrupt existing ssh connections. Proceed with operation (y|n)? y
ERROR: problem running ufw-init
modprobe: ERROR: ../libkmod/libkmod.c:514 lookup_builtin_file() could not open builtin file '/lib/modules/4.4.0-042stab127.2/modules.builtin.bin'
modprobe: FATAL: Module nf_conntrack_ftp not found in directory /lib/modules/4.4.0-042stab127.2
modprobe: ERROR: ../libkmod/libkmod.c:514 lookup_builtin_file() could not open builtin file '/lib/modules/4.4.0-042stab127.2/modules.builtin.bin'
modprobe: FATAL: Module nf_nat_ftp not found in directory /lib/modules/4.4.0-042stab127.2
modprobe: ERROR: ../libkmod/libkmod.c:514 lookup_builtin_file() could not open builtin file '/lib/modules/4.4.0-042stab127.2/modules.builtin.bin'
modprobe: FATAL: Module nf_conntrack_netbios_ns not found in directory /lib/modules/4.4.0-042stab127.2
iptables-restore: line 30 failed
iptables-restore: line 10 failed
iptables-restore: line 42 failed
iptables-restore v1.6.0: Couldn't load target `ufw-user-input':No such file or directory
Error occurred at line: 2
Try `iptables-restore -h' or 'iptables-restore --help' for more information.
ip6tables-restore: line 42 failed
ip6tables-restore: line 2 failed
ip6tables-restore: line 8 failed
ip6tables-restore: line 138 failed
ip6tables-restore v1.6.0: Couldn't load target `ufw6-skip-to-policy-input':No such file or directory
Error occurred at line: 19
Try `ip6tables-restore -h' or 'ip6tables-restore --help' for more information.
ip6tables-restore: line 10 failed
ip6tables-restore: line 42 failed
ip6tables-restore v1.6.0: Couldn't load target `ufw6-user-input':No such file or directory
Error occurred at line: 2
Try `ip6tables-restore -h' or 'ip6tables-restore --help' for more information.
sysctl: permission denied on key 'net.ipv4.tcp_sack'
Problem running '/etc/ufw/after.rules'
Problem running '/etc/ufw/user.rules'
Problem running '/etc/ufw/before6.rules'
Problem running '/etc/ufw/after6.rules'
Problem running '/etc/ufw/user6.rules'
I'm fairly new to this so I cannot really figure out what the problems are here.
Thank you!
/lib/modules/4.4.0-042stab127.2
doesn't sound like part of a regular Ubuntu kernel - can you clarify your exact system? – steeldriver Feb 10 '18 at 22:23In fact it's a server4you vServer and I restored it with "Ubuntu 16.04 LTS minimal" settings.
– Dom Feb 10 '18 at 22:42