Problem with ufw enable: libkmod: ERROR ../libkmod/libkmod.c

8,414

Solution 1

I have found out that my issue was related to peculiarities of using Ubuntu in an OpenVZ environment.

I was able to "fix" the problem (I beleive) by following those two resources:

http://blog.kylemanna.com/linux/2013/04/26/ufw-vps/

http://blog.bodhizazen.com/linux/how-to-use-ufw-in-openvz-templates/

Solution 2

Honestly, I find ufw completely useless for the average user. I have little knowledge about how to properly configure a firewall in Linux, and for that matter little knowledge about Linux itself.

This is the reason I need software packages with a friendly interface like they have in Windows. I use Firestarter to configure my firewall in Ubuntu, and I find it to be a reliable firewall once you change a few settings in Firestarter preferences. You can install firestarter with this code:

  sudo apt-get install firestarter

And after that you should edit the following file and change the lines commented out that create the relevant logfile:

  gksu leafpad /etc/rsyslog.d/50-default.conf

#.=info;.=notice;*.=warn;\

# auth,authpriv.none;\

# cron,daemon.none;\

# mail,news.none -/var/log/messages

All you have to do is to remove the # symbol preceding each line to uncomment all the above mentioned lines. After you save /etc/rsyslog.d/50-default.conf, you also need to restart rsyslog or reboot:

sudo service rsyslog restart

This way firestarter will work like a charm, and you can adjust its settings from Preferences. This link will send you to a nice tutorial with lots of graphic descriptions showing you how to properly configure Firestarter according to your needs.

Share:
8,414

Related videos on Youtube

Wes Souza
Author by

Wes Souza

Updated on September 18, 2022

Comments

  • Wes Souza
    Wes Souza over 1 year

    I am trying to enable ufw and this is the output:

    root@p:~# ufw enable
    Command may disrupt existing ssh connections. Proceed with operation (y|n)? y
    ERROR: problem running ufw-init
    libkmod: ERROR ../libkmod/libkmod.c:505 kmod_lookup_alias_from_builtin_file: could not open builtin file '/lib/modules/2.6.32-042stab078.27/modules.builtin.bin'
    FATAL: Module nf_conntrack_ftp not found.
    libkmod: ERROR ../libkmod/libkmod.c:505 kmod_lookup_alias_from_builtin_file: could not open builtin file '/lib/modules/2.6.32-042stab078.27/modules.builtin.bin'
    FATAL: Module nf_nat_ftp not found.
    libkmod: ERROR ../libkmod/libkmod.c:505 kmod_lookup_alias_from_builtin_file: could not open builtin file '/lib/modules/2.6.32-042stab078.27/modules.builtin.bin'
    FATAL: Module nf_conntrack_netbios_ns not found.
    iptables-restore: line 69 failed
    iptables-restore: line 30 failed
    ip6tables-restore: line 65 failed
    sysctl: permission denied on key 'net.ipv4.tcp_sack'
    
    Problem running '/etc/ufw/before.rules'
    Problem running '/etc/ufw/after.rules'
    Problem running '/etc/ufw/before6.rules'
    

    It's a fresh installation of an Ubuntu 13.04 64 bits, what is wrong?