centos 关闭selinux 临时关闭selinux 报错 setenforce: setenforce() failed
关闭selinux的方法有两种:临时关闭和永久关闭。
查看selinux的状态:estatus
[root@162-219-29-3 ~]# 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: disabled Policy MLS status: enabled Policy deny_unknown status: allowed Max kernel policy version: 31
1. 临时关闭:
临时关闭在重启后会失效。
临时关闭命令:
setenforce 0
查看是否关闭成功:
getenforce
临时关闭报错 setenforce: setenforce() failed ,问题是权限不够,我们需要管理员权限才可以。
[centos@ip123 ~]$ setenforce 0 setenforce: setenforce() failed
解决办法在root下执行:
su - root setenforce 0
2. 永久关闭:
编辑配置文件 /etc/selinux/config 。需要重启才可以生效
sed -i '/^SELINUX=/s/enforcing/disabled/' /etc/selinux/config
我们常用的方法是,先配置临时生效,再更改配置文件。这样就算服务器重启了,selinux也还是关闭的。
转载于:https://www.cnblogs.com/operationhome/p/9794109.html
centos 关闭selinux 临时关闭selinux 报错 setenforce: setenforce() failed相关推荐
- CentOS 7安装Development Tools 失败 报错 group tools does not exist. Maybe run: yum groups mark install
重装centos,以及迁移时,碰见这个问题.如下图: CentOS 7安装Development Tools 失败 报错 group tools does not exist. Maybe run: ...
- 报错curl: (7) Failed to connect to 127.0.0.1 port xxxx: Connection refused
(pyenv install xxx) 报错curl: (7) Failed to connect to 127.0.0.1 port xxxx: Connection refused的解决方法 问题 ...
- 解决只读模式U盘保护格式化或者dd写报错:ERROR: failed to open ‘/dev/sdb‘ in read-write mode: Read-only file system.
解决只读模式U盘保护格式化或者dd写报错:ERROR: failed to open '/dev/sdb' in read-write mode: Read-only file system. 或者: ...
- centos6.5报错:checking filesystems failed问题处理
centos系统重启报错:checking filesystems failed checking filesystems /dev/mapper/vg_0-root: 搜了下可能是文件系统损坏 根据 ...
- gitlab报错 fatal: index-pack failed error: RPC failed; result=18, HTTP code = 200解决方案
gitlab报错 "fatal: index-pack failed error: RPC failed; result=18, HTTP code = 200",如下图 这个问题 ...
- cordova编译报错:Execution failed for task ':processDebugResources'
cordova编译报错:Execution failed for task ':processDebugResources' 引发这个错误的最扩祸首就是一个中文命名的文件,不知道什么时候加入的,我写了 ...
- git配置报错fatal: Authentication failed for ‘‘问题解决
git配置报错fatal: Authentication failed for ''问题解决 参考文章: (1)git配置报错fatal: Authentication failed for ''问题 ...
- windows10下编译dllib报错: ERROR: Failed building wheel for dlib
一.报错信息 在安装dlib的时候,使用pip进行安装 pip install dlib 二.解决方式 1.检查自己是否已经安装了cmake 首先要检测自己本机是否已经安装了cmake,因为安装dli ...
- maven 项目报错Context initialization failed
Context initialization failed 当我对maven 项目进行clean 的时候再次打开就报错Context initialization failed 同时i显示找不到dao ...
最新文章
- 2012_01_26
- 面试题整理8 字符串的排列
- 2021-04-07 In literature VS In the literature
- javascript初级代码块
- linux git gui使用教程,跨平台最好用的Git GUI工具gitkraken
- linux检查防火墙是否阻挡端口,浅析linux查看防火墙状态和对外开放的端口状态...
- 52个有效方法(1) - 了解Objective-C语言的起源
- matlab用solve解方程错误提示,MATLAB中使用solve解决方程组的问题
- Ubuntu ssh 登陆问题
- 蓝桥杯ADV-172 算法提高 身份证排序
- AcWing 4243. 传递信息(单源最短路)
- 提高开发效率的十五个Visual Studio 2010使用技巧
- vb改变字形的代码是什么_求VB中调整字体颜色代码
- GoogleCode SVN应用(源代码学习)
- AI产品经理,如何面对数据挖掘?
- Java中的判断语句
- itextsharp 获取文本_利用iTextSharp提取PDF文件中的文本内容
- java 在线excel_开源Excel在线协同工具
- 【群晖nas】阿里域名DDNS 配置外网访问(华硕AC68U路由端口映射)
- bzoj1911【APIO2010】特别行动队