网站运营
位置:首页>> 网站运营>> 关闭selinux(防火墙)方法分享

关闭selinux(防火墙)方法分享

  发布时间:2022-11-03 20:49:35 

标签:selinux,防火墙

刚好手工装完一台CentOS6.4,就顺便记录一下。


# sestatus
SELinux status:                 enabled
SELinuxfs mount:                /selinux
Current mode:                   enforcing
Mode from config file:          enforcing
Policy version:                 24
Policy from config file:        targeted

你可以运行下面命令,马上禁用selinux


setenforce 0*/

这个时候你查看selinux的状态


# sestatus
SELinux status:                 enabled
SELinuxfs mount:                /selinux
Current mode:                   permissive
Mode from config file:          enforcing
Policy version:                 24
Policy from config file:        targeted

对比一下,你就可以看出变化。

重启后,设置就失效。

如果你希望重启生效,那么你就需要修改配置文件

/etc/selinux/config


#SELINUX=enforcing
SELINUX=disabled

或者你可以运行下面命令


sed -i '/SELINUX/s/enforcing/disabled/' /etc/selinux/config

这个时候,你重启机器,再查看selinux的状态


# sestatus
SELinux status: disabled

0
投稿

猜你喜欢

手机版 网站运营 asp之家 www.aspxhome.com