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

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.