首页 > 技术文章 > seliux(类似防火墙,限制root用户)

wangguangtao 2018-10-21 20:06 原文

注:如果在开发是不设置关闭,可能会出现很多不在预期内的效果

  路径:/etc/selinux/config

  *修改(修改时拷贝对照)

(拷贝):cp /etc/selinux/config /etc/selinux/config.qe

(替换):sed -i "s#SELINUX=enforing#SELINUX=disabled#g" /etc/selinux/config

***由于linux必须重启命令才能生效,所以为了保证服务器正常运行可以先改变config中的命令,

然后使用(setenforce临时启动),查看当前状态(getenforce)。

关闭防火墙:/etc/init.d/iptables stop (临时)

查看防火墙状态:/etc/init.d/iptables status(查看防火墙状态)

保存关闭防火墙指令下次开机不启动: chkconfig iptables off

推荐阅读