SELinux 开启和关闭

简介: 查看SELinux状态: 1、/usr/sbin/sestatus -v      ##如果SELinux status参数为enabled即为开启状态 SELinux status:                 enabled 2、getenforce                 ##也可以用这个命令检查 关闭SELinux: 1、临时关闭(不用重启机器): sete

查看SELinux状态:

1、/usr/sbin/sestatus -v      ##如果SELinux status参数为enabled即为开启状态

SELinux status:                 enabled

2、getenforce                 ##也可以用这个命令检查

关闭SELinux:

1、临时关闭(不用重启机器):

setenforce 0                  ##设置SELinux 成为permissive模式

                              ##setenforce 1 设置SELinux 成为enforcing模式

2、修改配置文件需要重启机器:

修改/etc/selinux/config 文件

将SELINUX=enforcing改为SELINUX=disabled

重启机器即可

目录
相关文章
|
7天前
|
Linux Android开发
代码里永久关闭selinux
代码里永久关闭selinux
22 0
|
15天前
|
弹性计算 运维 Shell
关闭 SELinux
【4月更文挑战第29天】
8 0
|
15天前
|
弹性计算 运维 Shell
关闭SELinux
【4月更文挑战第29天】
18 0
关闭开机启动项
关闭开机启动项
969 0
关闭开机启动项
|
Linux
18.13 SELinux策略规则的开启和关闭
默认情况下,并不是所有的规则都处于开启状态,因此,虽然我们无需修改规则的具体内容,但学习如何开启和关闭规则,还是很有必要的。
198 0
18.13 SELinux策略规则的开启和关闭
|
网络协议 网络安全 Linux
Firewalld打开、关闭端口
1、firewalld的基本使用 启动: systemctl start firewalld 查看状态: systemctl status firewalld  停止: systemctl disable firewalld 禁用: systemctl stop firewalld 2.systemctl是CentOS7的服务管理工具中主要的工具,它融合之前service和chkconfig的功能于一体。
1236 0