iptablesというのはLinux系OSで使われいるファイヤウォールみないたものですね。VPSで自分でサーバを管理していると常に世界中から攻撃がきますので、適宜こういったツールで攻撃を防ぐ必要がありますよね。sshやPHPmyadminを狙ったアクセスが特に多いですね。 ここではiptablesを設定するためにiptales-pesistentというツールを使用してみます。これを使うことで設定ファイルに設定することができます。 Ubuntu 18.04で実施してます インストール $ sudo apt-get install iptables-persistent ipv4,ipv6用ファイル保存を確認されますので、yesしときます。 インストールが成功すると /etc/iptables/ipv4.rules /etc/iptables/ipv6.rules と設定ファイルが2つできます