CentOS7.6にSELinuxを無効化にする方法

1.SELinuxの設定状態を確認
#getenforce
Enforcing

2.設定ファイルを修正する
#vim /etc/selinux/config

# This file controls the state of SELinux on the system.
# SELINUX= can take one of these three values:
# enforcing – SELinux security policy is enforced.
# permissive – SELinux prints warnings instead of enforcing.
# disabled – No SELinux policy is loaded.
SELINUX=disabled
# SELINUXTYPE= can take one of three two values:
# targeted – Targeted processes are protected,
# minimum – Modification of targeted policy. Only selected processes are protected.
# mls – Multi Level Security protection.
SELINUXTYPE=targeted

修正前
SELINUX=enforcing
修正後
SELINUX=disabled

3.OS再起動
#shutdown -r now

4.SELinuxの状態を再度確認
#getenforce
Disabled

5.一時無効
# sudo setenforce 0
# sudo getenforce
Permissive

Linux

Posted by arkgame