博客
关于我
强烈建议你试试无所不能的chatGPT,快点击我
centos 7.0 查看selinux状态|关闭|开启
阅读量:7061 次
发布时间:2019-06-28

本文共 1223 字,大约阅读时间需要 4 分钟。

Linux在安装好之后通常SELinux都是出于默认开启的状态,开启的情况下会导致一些服务的安装不成功。

在不需要的情况下完全可以关闭掉,下面是在centos 7.0里面如何查看,关闭selinux。

查看selinux状态

1
2
3
4
5
6
7
8
9
10
[root@localhost ~]
# sestatus  
SELinux status:                 enabled  
SELinuxfs 
mount
:                
/sys/fs/selinux  
SELinux root directory:         
/etc/selinux  
Loaded policy name:             targeted  
Current mode:                   enforcing  
Mode from config 
file
:          enforcing  
Policy MLS status:              enabled  
Policy deny_unknown status:     allowed  
Max kernel policy version:      28

临时关闭

1
[root@localhost ~]
# setenforce 0

永久关闭,可以修改配置文件/etc/selinux/config,将其中SELINUX设置为disabled

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
[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  
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
 
[root@rdo ~]
# sestatus  
SELinux status:                 disabled

 

转载本篇文章请注明文章原出处:

你可能感兴趣的文章
针对百度搜索上线的极光算法,我们应该怎样应对?
查看>>
WordPress文件结构
查看>>
Linux Shell脚本编程基础
查看>>
另一种快速排序
查看>>
数字黑洞
查看>>
2017.04
查看>>
Yesod - 表单 (7)
查看>>
jQuery 如何获取浏览器所在的IP地址
查看>>
S2JH新增WIKI页面:开发基础环境配置说明,基于SSH的企业Web应用开发框架
查看>>
IO流-设置输出字符编码格式
查看>>
知识图谱完整项目实战(附源码)(1)
查看>>
svn hooks同步更新
查看>>
Java程序员从笨鸟到菜鸟之(七十一)细谈struts2(十三)struts2实现文件上传和下载详解...
查看>>
Feign http 请求跟踪—乱码及连接池
查看>>
python unittest库 官方网站
查看>>
shell脚本安装 nfs-server
查看>>
System Center 2012R2之SCDPM保护SQL数据库
查看>>
課堂實驗:SIP Server
查看>>
Ubuntu中打开终端
查看>>
Linux 的启动流程
查看>>