CentOS7關閉SELINUX


安全增強型Linux(Security-Enhanced Linux)簡稱SELinux,它是一個 Linux 內核模塊,也是Linux的一個安全子系統。為了避免安裝過程出現各種錯誤,建議關閉,有如下兩種關閉方法:

1)臨時關閉(不建議使用)

[root@hadoop101 ~]# setenforce 0

但是這種方式只對當次啟動有效,重啟機器后會失效。

2)永久關閉(建議使用)

修改配置文件/etc/selinux/config

[root@hadoop101 ~]# vim /etc/selinux/config

將SELINUX=enforcing 改為SELINUX=disabled

# 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=enforcing
SELINUX=disabled
# SELINUXTYPE= can take one of three values:
#     targeted - Targeted processes are protected,
#     minimum - Modification of targeted policy. Only selected processes are protected.
#     mls - Multi Level Security protection.
SELINUXTYPE=targeted

3)同步/etc/selinux/config配置文件(這一步是針對集群環境中,參考:使用集群同步腳本對配置文件同步分發

[root@hadoop101 ~]# xsync /etc/selinux/config

4)重啟主機

[root@hadoop101 ~]# reboot

[root@hadoop102 ~]# reboot

[root@hadoop103 ~]# reboot

 


免責聲明!

本站轉載的文章為個人學習借鑒使用,本站對版權不負任何法律責任。如果侵犯了您的隱私權益,請聯系本站郵箱yoyou2525@163.com刪除。



 
粵ICP備18138465號   © 2018-2025 CODEPRJ.COM