查看SELinux状态及关闭SELinux

更新时间:2023-05-30 03:50:45 阅读: 评论:0

查看SELinux状态及关闭SELinux ⼀、查看SELinux状态:
1、我们可以通过查看配置⽂件的命令 cat /etc/linux/config 来查看状态
[root@lill ~]# cat /etc/linux/config
游仙诗# This file controls the state of SELinux on the system.
# SELINUX= can take one of the three values:
#    enforcing - SELinux curity policy is enforced.
#    permissive - SELinux prints warnings instead of enforcing.
#    disabled - No SELinux policy is loaded.
SELINUX=enforcing
# SELINUXTYPE= can take one of the two values:
脚本生成器澳大利亚欧泊#    targeted - Targeted process are protected,
#    mls - Multi Level Security protection.
SELINUXTYPE=targeted
发现SELinux共有3个状态enforcing (执⾏中)、permissive (不执⾏但产⽣警告)、disabled(关闭)。2,也可以⽤这个命令检查:getenforce
[root@localhost /]# getenforce
Enforcing
3、也可以⽤下述命令;如果SELinux status参数为enabled即为开启状态
人参作用[root@localhost /]# /usr/sbin/status -vadvice用法
SELinux status:                enabled
⼆、关闭SELinux:
寻梦环游记英文社会主义道德建设的核心1、临时关闭(重启机器后失效):
#tenforce 0设置为permissive模式;tenforce 1 设置为enforcing模式;
静成语
tenforce 0
2、永久关闭(需要重启机器):
d -i s#SELINUX=enforcing#SELINUX=disabled# /etc/linux/config
重启机器即可

本文发布于:2023-05-30 03:50:45,感谢您对本站的认可!

本文链接:https://www.wtabcd.cn/fanwen/fan/89/949789.html

版权声明:本站内容均来自互联网,仅供演示用,请勿用于商业和其他非法用途。如果侵犯了您的权益请与我们联系,我们将在24小时内删除。

标签:关闭   状态   命令   查看   重启
相关文章
留言与评论(共有 0 条评论)
   
验证码:
推荐文章
排行榜
Copyright ©2019-2022 Comsenz Inc.Powered by © 专利检索| 网站地图