selinux 关闭

查看selinux状态

sestatus 命令linux

[benny@benny ~]$ sestatus
SELinux status:                 disabled

临时关闭

[benny@benny ~]$ setenforce  0
setenforce: SELinux is disabled

永久关闭

修改配置文件/etc/selinux/config,将其中SELINUX设置为disabledshell

# 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