CentOS7.Xは次のとおりです。
1.ファイアウォール
ファイアウォールの状態を表示します。
[root@localhost sunan]# systemctl status firewalld.service
● firewalld.service - firewalld - dynamic firewall daemon
Loaded: loaded (/usr/lib/systemd/system/firewalld.service; disabled; vendor preset: enabled)
Active: inactive (dead)
Docs: man:firewalld(1)
アクティブ状態にアクティブ閉じた状態、(ランニング)中(死んだ)非アクティブであります
firewallコマンドをオフにします:
[root@localhost sunan]# systemctl stop firewalld.service
firewallコマンドを開きます。
[root@localhost sunan]# systemctl start firewalld.service
永久にfirewallコマンドを無効にする(最初から起動しません)
[root@localhost sunan]# systemctl disable firewalld.service
Removed symlink /etc/systemd/system/multi-user.target.wants/firewalld.service.
Removed symlink /etc/systemd/system/dbus-org.fedoraproject.FirewallD1.service.
永久開始firewallコマンド(ポスト打ち上げ)
[root@localhost sunan]# systemctl enable firewalld.service
Created symlink from /etc/systemd/system/dbus-org.fedoraproject.FirewallD1.service to /usr/lib/systemd/system/firewalld.service.
Created symlink from /etc/systemd/system/multi-user.target.wants/firewalld.service to /usr/lib/systemd/system/firewalld.service.
CentOS6.Xは次のとおりです。
1.ファイアウォール
ファイアウォールの状態を表示します。
[root@localhost ~]# service iptables status
firewallコマンドをオフにします:
[root@localhost ~]# service iptables stop
iptables: Setting chains to policy ACCEPT: filter [ OK ]
iptables: Flushing firewall rules: [ OK ]
iptables: Unloading modules: [ OK ]
firewallコマンドを開きます。
[root@localhost ~]# service iptables start
iptables: Applying firewall rules: [ OK ]
永久にfirewallコマンドを無効にする(最初から起動しません)
[root@localhost ~]# chkconfig iptables off
永久開始firewallコマンド(ポスト打ち上げ)
[root@localhost ~]# chkconfig iptables on
2.selinux(CentOS7.X同CentOS6.X)
ビューSELinuxの状態:
[root@localhost sunan]# getenforce
Enforcing
:SELinuxの状態は、次の3つのモードがある
強制:強制モード、SELinuxのランニングの代わりにして、右のドメイン/タイプを制限し始めています。
許容:許容範囲モードでは、SELinuxの操作に代わって、そこだけの情報を警告となり、実際のドメイン/タイプへのアクセスを制限しません。SELinuxが、このモードでは、デバッグ目的に使用することができます
無効:オフ、SELinuxの実際に稼働していません。
コマンドは、SELinuxを設定し、前提が無効な状態ではありません。
[root@localhost ~]# setenforce 0
[root@localhost ~]# getenforce
Permissive
0ここでsetenforce | 1
0:状態premissive設定;
1:状態の施行に設定する。
この設定:無効、システムを再起動します。
設定ファイルを変更し、設定SELinuxは無効な状態です。
[root@localhost ~]# vim /etc/selinux/config
SELINUX=disabled
SELINUXTYPE=targeted
保存し、有効にするシステムを再起動します。