Step 1 確認SELinux是否被啟動 SELinux停止運作狀態
[andy@www ~]$ sudo sestatus
SELinux status: disabled
SELinux正常運作狀態
[andy@www ~]# sudo sestatus
SELinux status: enabled
SELinuxfs mount: /selinux
Current mode: enforcing
Mode from config file: enforcing
Policy version: 21
Policy from config file: targeted
---------------------------------
STEP 2
暫時停止SELinux
(重開機之後,會恢復原始設定)
[andy@www ~]$ sudo setenforce 0
STEP 3
andy@www ~]$ sudo 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:將第6行改為SELINUX=disable
永久啟用SELinux:將第6行改為SELINUX=enable 下次重開機時就會套用設定檔的設定值了
|