1. View
[root@dev-server ~]# getenforceDisabled[root@dev-server ~]# /usr/sbin/sestatus -vSELinux status: disabled
2. Temporary closure
##设置SELinux 成为permissive模式##setenforce 1 设置SELinux 成为enforcing模式setenforce 0
3. Permanently closed
vi /etc/selinux/config
Change Selinux=enforcing to Selinux=disabled
Requires a restart to take effect after Setup
CentOS 7.0 View selinux status | off | open
When Linux is installed, it is usually the case that SELinux is turned on by default, which causes the installation of some services to be unsuccessful.
It can be completely closed if not needed, here is how to view it in CentOS 7.0 and turn off SELinux.
View selinux Status
[[email protected] ~]
# sestatus
SELinux status: enabled
SELinuxfs
mount
:
/sys/fs/selinux
SELinux root directory:
/etc/selinux
Loaded policy name: targeted
Current mode: enforcing
Mode from config
file
: enforcing
Policy MLS status: enabled
Policy deny_unknown status: allowed
Max kernel policy version: 28
|
temporarily closed
[[email protected] ~] # setenforce 0 |
permanently closed
You can modify the configuration file/etc/selinux/config to set the SELinux to Disabled.
[[email protected] ~]
# cat /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=enforcing
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
[[email protected] ~]
# sestatus
SELinux status: disabled
CentOS 7.X off SELinux