ICode9

精准搜索请尝试: 精确搜索
首页 > 系统相关> 文章详细

将selinux 的值设置成disabled

2022-09-11 13:33:24  阅读:251  来源: 互联网

标签:selinux disabled etc 设置 SELinux config root


菜鸟:小辉

 

进入到Linux的终端

[qwe@zxc ~]$ su root

切换的root下面

 

直接输入 vi 文件名 就能够进入 vi 的一般模式了。请注意,记得 vi 后面一定要加文件名,不管该文件存在与否!

[root@zxc qwe]# vim /etc/selinux/config

 

之后会出现以下内容:

发现交换文件 "/etc/selinux/.config.swp"
所有者: root 日期: Sun Sep 11 11:10:55 2022
文件名: /etc/sysconfig/selinux
修改过: 否
用户名: root 主机名: zxc
进程 ID: 2965
正在打开文件 "/etc/selinux/config"
日期: Sun Sep 11 12:36:46 2022
比交换文件新!

(1) Another program may be editing the same file. If this is the case,
be careful not to end up with two different instances of the same
file when making changes. Quit, or continue with caution.
(2) An edit session for this file crashed.
如果是这样,请用 ":recover" 或 "vim -r /etc/selinux/config"
恢复修改的内容 (请见 ":help recovery")。
如果你已经进行了恢复,请删除交换文件 "/etc/selinux/.config.swp"
以避免再看到此消息。

交换文件 "/etc/selinux/.config.swp" 已存在!
以只读方式打开([O]), 直接编辑((E)), 恢复((R)), 删除交换文件((D)), 退出((Q)), 中止((A)):

 

输入 E,之后出现的内容程序

# 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    #这个地方改成 disabled    #按i进入编辑模式
# SELINUXTYPE= can take one of three values:
# targeted - Targeted processes are protected,
# minimum - Modification of targeted policy. Only selected processes are protected.
# mls - Multi Level Security protection.
SELINUXTYPE=targeted

 

 

编辑完成之后,按ESC键 和 SHIFT  和 冒号  底部会出现 冒号 :    之后在冒号的后面输入wq  保存保存文件并退出vi

之后重启虚拟机

shutdown -r now

 

输入命令:

重启后,运行命令getenforce,验证SELinux状态为disabled,表明SELinux已关闭。

 

[root@zxc qwe]# sestatus

 

SELinux status: disabled

 

标签:selinux,disabled,etc,设置,SELinux,config,root
来源: https://www.cnblogs.com/xxh12/p/16683838.html

本站声明: 1. iCode9 技术分享网(下文简称本站)提供的所有内容,仅供技术学习、探讨和分享;
2. 关于本站的所有留言、评论、转载及引用,纯属内容发起人的个人观点,与本站观点和立场无关;
3. 关于本站的所有言论和文字,纯属内容发起人的个人观点,与本站观点和立场无关;
4. 本站文章均是网友提供,不完全保证技术分享内容的完整性、准确性、时效性、风险性和版权归属;如您发现该文章侵犯了您的权益,可联系我们第一时间进行删除;
5. 本站为非盈利性的个人网站,所有内容不会用来进行牟利,也不会利用任何形式的广告来间接获益,纯粹是为了广大技术爱好者提供技术内容和技术思想的分享性交流网站。

专注分享技术,共同学习,共同进步。侵权联系[81616952@qq.com]

Copyright (C)ICode9.com, All Rights Reserved.

ICode9版权所有