VPS上のUbuntuでufwを有効にする


とあるVPSを借りているのですが、ufwをenableすると


$ 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:507 kmod_lookup_alias_from_builtin_file() could not open builtin file ‘/lib/mo
dules/2.6.32-042stab092.2/modules.builtin.bin’
modprobe: FATAL: Module nf_conntrack_ftp not found.

などとエラーになります。

https://blog.kylemanna.com/linux/ufw-vps/

を参考に、

Open /etc/default/ufw
Comment out the line starting with “IPT_MODULES” and “IPV6”

で解決するも、さらに

[Errno 2] iptables: Memory allocation problem.

が出るようになる。どうもVPSではiptablesのルールの数に制限がある模様。

でも、とりあえずsshのルールを一つ削除したら出なくなったのでよいことにします。


1 thought on “VPS上のUbuntuでufwを有効にする”

  1. [Errno 2] iptables: Memory allocation problem.

    は、いったん ufw disable してからufw enableすれば済む問題だったみたい。ルールを消す必要はなかった。

Leave a Reply

メールアドレスが公開されることはありません。 が付いている欄は必須項目です