首页 > 系统服务 > 详细

selinux详解

时间:2017-04-05 00:09:07      阅读:256      评论:0      收藏:0      [点我收藏+]

查看selinux配置文件

[root@localhost ~]# 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

修改selinux为关闭状态


方法一

[root@localhost ~]# 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 these two values:

#     targeted - Targeted processes are protected,

#     mls - Multi Level Security protection.

SELINUXTYPE=targeted

在vi下按“i”进行编辑,讲enforcing改为disabled

按“esc”退出编辑模式,“:wq ” 保存退出



检查:cat /etc/selinux/config



方法二

设置:sed -i s#SELINUX=enforcing#SElINUX=disabled#g /etc/selinux/config

检查:grep "disable" /etc/selinux/config


以上永久关闭selinux,重启生效




查看selinux状态:

[root@localhost ~]# getenforce 

Enforcing

临时关

[root@localhost ~]# setenforce 0

[root@localhost ~]# getenforce 

Permissive

即时生效



selinux详解

原文:http://zzzhbr.blog.51cto.com/6480548/1912812

(0)
(0)
   
举报
评论 一句话评论(0
关于我们 - 联系我们 - 留言反馈 - 联系我们:wmxa8@hotmail.com
© 2014 bubuko.com 版权所有
打开技术之扣,分享程序人生!