Linux临时和永久关闭Selinux

版权声明:作者:傲娇天子 博文主页地址:https://blog.csdn.net/qq_41116956 欢迎转载,转载请在文章页面明显位置给出原文链接,谢谢 https://blog.csdn.net/qq_41116956/article/details/82767604

查看当前Selinux状态:

[root@localhost ~]# getenforce 
Enforcing

临时关闭Selinux:

[root@localhost ~]# setenforce 0
[root@localhost ~]# getenforce 
Permissive
[root@localhost ~]# 

永久关闭Selinux:

[root@localhost ~]# vim /etc/sysconfig/selinux
# 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=enforcingdisabled
# 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=enforcing

改成:

SELINUX=disabled

注意:修改Selinux永久关闭,必须重启服务器

猜你喜欢

转载自blog.csdn.net/qq_41116956/article/details/82767604