Linuxのファイヤーウォール(iptables)とSELinuxを停止&無効化

ちゃんと設定しなくていいサーバの場合、ファイヤーウォールSELinuxが動いていたら、外から見るのにいろいろ不都合なので、停止&無効化するのです。

iptables

$ /etc/rc.d/init.d/iptables stop
$ chkconfig iptables off
$ chkconfig --list iptables 
iptables        0:off   1:off   2:off   3:off   4:off   5:off   6:off

SELinux

動作状態の確認
$ getenforce
Enforcing
  • Enforcing    SELinux機能は有効でアクセス制御も有効。
  • permissive   SElinuxはwarningを出すが、アクセス制限は行われません
  • disabled    SElinux機能・アクセス制御ともに無効
SELinuxを一時的に無効化
$ setenforce 0
SELinuxを復活
$ setenforce 1
SELinuxの完全無効化
vi /etc/sysconfig/selinux
SELINUX=enforcing
   ↓
SELINUX=disabled

設定ファイルを変更したら、あとはrebootすればOK

iptablesSELinuxのちゃんとした設定はおいおいやる予定。。。。