Categories: Ubuntu

さくらのvpsのubuntuでufwが有効にならない

最近のubuntuはufwでポート変更ができるらしいが、さくらのVPSでやろうとしたら認識しなかったのでその対策メモ。

答えはこのへんにあった

先日さくらのVPSをレンタルし,Ubuntu Server 16.04 LTSをインストールしました. Ubuntuにはiptablesをシンプルにしたufwというものがあるようなので,これを使ってファイヤウォールの設定を行おうと思っていました. 例えば,仮にssh
ufwを適用するためにiptablesを初期化したらaptが接続できなくなった|teratail - teratail[テラテイル]

どうやら、さくら側でデフォルトでiptablesの設定がはいっており、それが邪魔しているようで反映されないようだった。

そのため、iptablesの設定をふっとばすことで無事ufwが使えるようになりました。

(iptables -Fだけだと再起動後にまだiptablesの設定が反映される)

mv /etc/iptables/iptables.rules /var/tmp
reboot

mogmet

View Comments

  • After reading your article, it reminded me of some things about gate io that I studied before. The content is similar to yours, but your thinking is very special, which gave me a different idea. Thank you. But I still have some questions I want to ask you, I will always pay attention. Thanks.

  • Do you mind if I quote a couple of your articles as long asI provide credit and sources back to your website?My blog site is in the very same niche as yours and my users would certainly benefit from some of the information you present here.Please let me know if this okay with you. Thanks!

Share
Published by
mogmet
Tags: Server