找回密码
 立即注册
查看: 1379|回复: 0

关闭centos中的SELinux

[复制链接]

6782

主题

8

回帖

2万

积分

管理员

积分
21779
发表于 2019-5-20 20:27:44 | 显示全部楼层 |阅读模式
SELinux可以简单的理解为增加了安全性的linux系统,更多的理解,可以自行寻找答案,这里不再复述,下面是关闭SELinux的方法。

首先,使用getendorce或者sestatus命令查看当前selinux的状态,如果是非关闭的状态,就继续关闭它。

然后找到 /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

将其修改为:

# 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 these two values:
#     targeted - Targeted processes are protected,
#     mls - Multi Level Security protection.
SELINUXTYPE=targeted

另外,还需查看启动菜单文件: /boot/grub/menu.lst中是否有selinux=0这个选项,如果存在,则必须要将其删除才可。

最后重新启动系统,就OK了。
回复

使用道具 举报

您需要登录后才可以回帖 登录 | 立即注册

本版积分规则

快速回复 返回顶部 返回列表