Linux| 关闭SELINUX

版权声明:本文为博主原创文章,未经博主允许不得转载。 https://blog.csdn.net/u011479200/article/details/86657641

检查SELINUX的状态
检查命令:
/usr/sbin/sestatus


/usr/sbin/getenforce
在这里插入图片描述
从上图可以知道已经关闭了SELINUX,如果没有关闭可以通过修改/etc/selinux/config文件来关闭:
vi /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=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

将属性SELINUX设置成disabled既可.

因为设置完成后,需要重启才能生效,但linux生产环境中一般不能重启,此时可以使用上面提到的setenforce 0来临时关闭SELINUX,这样也能正常使用,重启后,状态会变为disabled。

参考:
https://blog.51cto.com/zhaodongwei/1745837

猜你喜欢

转载自blog.csdn.net/u011479200/article/details/86657641
今日推荐