关闭selinux功能
Posted
tags:
篇首语:本文由小常识网(cha138.com)小编为大家整理,主要介绍了关闭selinux功能相关的知识,希望对你有一定的参考价值。
关闭SELinux功能
1.永久关闭
1.1检查、备份
永久关闭selinux
1.操作前备份
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
# SELINUXTYPE= can take one of these two values:
# targeted - Targeted processes are protected,
# mls - Multi Level Security protection.
SELINUXTYPE=targeted
cp /etc/selinux/config /etc/selinux/config.bak
ls -l /etc/selinux/config*
-rw-r--r--. 1 root root 458 Jul 14 11:02 /etc/selinux/config
-rw-r--r--. 1 root root 458 Jul 15 02:08 /etc/selinux/config.bak
2.sed修改,看看结果,不加-i
This file controls the state of SELinux on the system.
SELINUX= can take one of these three values:
enforcing - selinux 已经启动 已经开启
permissive selinux 临时停用 会显示警告
disabled - selinux 彻底关闭 不再运行
SELINUX=enforcing 修改为 disabled
3. 修改selinux配置
cat /etc/selinux/config
This file controls the state of SELinux onthe system.
SELINUX= can take one of these threevalues:
enforcing - SELinux security policy is enforced.
permissive - SELinux prints warnings instead of enforcing.
disabled - No SELinux policy is loaded.
SELINUX=disabled
SELINUXTYPE= can take one of these twovalues:
cat /etc/selinux/config
This file controls the state of SELinux onthe system.
SELINUX= can take one of these threevalues:
enforcing - SELinux security policy is enforced.
permissive - SELinux prints warnings instead of enforcing.
disabled - No SELinux policy is loaded.
SELINUX=disabled
SELINUXTYPE= can take one of these twovalues:
4.临时关闭SELinux
临时关闭selinux
1.查看selinux状态
getenforce
Enforcing
2.关闭selinux
setenforce
usage: setenforce [ Enforcing | Permissive | 1 | 0 ]
setenforce 0
getenforce
Permissive
3.重启服务器之后失效
本文出自 “heyong” 博客,请务必保留此出处http://heyong.blog.51cto.com/13121269/1954573
以上是关于关闭selinux功能的主要内容,如果未能解决你的问题,请参考以下文章