如果SELinux处于开启状态,该命令将返回Enforcing。 4. 修改SELinux的配置文件以关闭它 有两种方法可以永久关闭SELinux: 方法一:使用sed命令直接修改配置文件 在终端中输入以下命令: bash sed -i 's/SELINUX=enforcing/SELINUX=disabled/g' /etc/selinux/config 这条命令会使用sed工具直接修改/etc/selinux/config...
临时关闭selinux 临时关闭命令: 代码语言:javascript 复制 setenforce0 查看selinux状态 代码语言:javascript 复制 getenforce 提示:Permissive的话是不起用服务,但是会打印通知 永久关闭: 最好修改之前备份一下文件,防止出现问题后恢复文件位置:/etc/selinux/config修改替换selinux状态 代码语言:javascript 复制 sed-i's...
将SELINUX=enforcing改为SELINUX=disabled 设置后需要重启才能生效 方法二: [root@192 ~]# sed -i ”s/SELINUX=enforcing/SELINUX=disabled/“ /etc/selinux/config centos 7.0 查看selinux状态|关闭|开启 Linux在安装好之后通常SELinux都是出于默认开启的状态,开启的情况下会导致一些服务的安装不成功。 在不需...
sed -i 's/=enforcing/=disabled/' /etc/selinux/config setenforce 0 二.更改为阿里yum源 mv /etc/yum.repos.d/CentOS-Base.repo /etc/yum.repos.d/CentOS-Base.repo.backup wget -O /etc/yum.repos.d/CentOS-Base.repo http://mirrors.aliyun.com/repo/Centos-7.repo yum makecache 三.优化ssh远程...
永久关闭selinux方法1 1 运行命令sudo vim /etc/sysconfig/selinux 2 找到行SELINUX=enforcing 3 替换为SELINUX=disabled保存退出reboot 4 重启后 运行命令 sestatusSELinux status : disabled永久关闭selinux成功 永久关闭selinux方法2 1 运行命令sudo sed -i 's/SELINUX=enforcing/SELINUX=disabled/&#...
SELinux root directory: /etc/selinux Loaded policy name: targeted Current mode: permissive Mode from config file: enforcing Policy MLS status: enabled Policy deny_unknown status: allowed Max kernel policy version: 28 2、如果要永久关闭,可以修改配置文件/etc/selinux/config,将SELINU置为disabled。
关闭开机自启动 systemctl disable firewalld.service 查看状态 systemctl status firewalld.service 关闭selinux setenforce 0 查看状态 getenforce 修改selinux配置文件 sed -i 's#SELINUX=enforcing#SELINUX=disabled#g' /etc/sysconfig/selinux 查看是否修改成功 grep SELINUX=disabled /etc/sysconfig/selinux ...
#临时关闭selinux,跟原来的版本一样的 [root@17-Cobbler ~]# setenforce 0 [root@17-Cobbler ~]# getenforce Permissive #问题就是在修改配置文件 #按照CentOS 6修改配置文件的位置:/etc/sysconfig/selinux [root@17-Cobbler ~]# sed -i "s#SELINUX=enforcing#SELINUX=disabled#g" /etc/sysconfig/selinux...
Centos7 关闭SELINUX,关闭SELINUXvi/etc/selinux/config修改SELINUX=disabled命令修改:sed-i's/SELINUX=enforcing/SELINUX=disabled/'/etc/selinux/config重启reboot查看状态sestatus
1、查看selinux状态 查看selinux的详细状态,如果为enable则表示为开启 /usr/sbin/sestatus -v 查看selinux的模式 getenforce 2、关闭selinux 2.1:永久性关闭(这样需要重启服务器后生效)sed -i 's/SELINUX=enforcing/SELINUX=disabled/' /etc/selinux/config 2.2:临时性关闭(立即生效,但是重启...