linux优化之SElinux关闭

  查看selinux状态:

    # getenforce   注:Enforcing表示开启,Permissive表示禁用

  临时关闭或开启selinux:

    # setenforce  [1|0]  注:1是开启,0是关闭

  永久关闭selinux,需要重启生效,所有一般配合setenforce 0使用:

    修改/etc/selinux/config文件中SELINUX=enforcing为SELINUX=disabled;

      备份配置文件:cp -a /etc/selinux/config /etc/selinux/config.bak;

      修改配置文件:sed -i 's/SELINUX=enforcing/SELINUX=disabled/g';

    

原文地址:https://www.cnblogs.com/Stong/p/6811839.html