CentOS7 关闭selinux

Posted 小狮儿

tags:

篇首语:本文由小常识网(cha138.com)小编为大家整理,主要介绍了CentOS7 关闭selinux相关的知识,希望对你有一定的参考价值。

SELinux, an abbreviation of Security-Enhanced Linux, is a security enhancement to the Linux operating system. It is a labeling system that blocks many system functions in its default configuration.

SELinux is very useful for some users, but due to its administrative overhead, you may be better off simply disabling it. The time spent adding rules and updating permissions on SELinux versus the added security benefit may not be worth it.

First check if SELinux is disabled or enabled:

sestatus

If this command returns "SELinux status: enabled", you can disable SELinux with the following command.

setenforce 0

The command above will only disable SELinux for now, but the change will be reverted across reboots. Therefore, disable it permanently by opening the file /etc/sysconfig/selinux and replace the current SELINUX directive with a value of disabled so it looks like this:

vim /etc/sysconfig/selinux
SELINUX=disabled

Check the SELinux status again to make sure that it has been properly disabled.

sestatus

以上是关于CentOS7 关闭selinux的主要内容,如果未能解决你的问题,请参考以下文章

Centos7下查看并关闭selinux

CentOS7 关闭selinux

centos7——关闭防火墙和SElinux

centos7 关闭firewall安装iptables并配置,关闭SELINUX

永久关闭selinux | 防火墙

关闭centos7防火墙