在CentOS 6.0下面永久关闭SELinux和防火墙
2014-03-27 20:14
399 查看
1 vi /etc/selinux/config
2 #SELINUX=enforcing #注释掉
3 #SELINUXTYPE=targeted #注释掉
4 SELINUX=disabled #增加
5 :wq #保存,关闭。
6 shutdown -r now #重启系统
查看SELinux的状态:
getenforce
新安装完CentOS Linux,发现配置完apache后没法访问,估计是防火墙问题。
/etc/init.d/iptables status
会得到一系列信息,说明防火墙开着。
/etc/init.d/iptables stop
永久关闭:
chkconfig --level 35 iptables off
永久关闭SELinux
查看当前SELinux状态:
/usr/bin/setstatus -v
编辑/etc/selinux/config,找到SELINUX 行修改成为:SELINUX=disabled:
# This file controls the state of SELinux on the system.
# SELINUX= can take one of these three values:
# enforcing - SELinux security policy is enforced.
# permissive - SELinux prints warnings instead of enforcing.
# disabled - No SELinux policy is loaded.
SELINUX=disabled
# SELINUXTYPE= can take one of these two values:
# targeted - Only targeted network daemons are protected.
# strict - Full SELinux protection.
SELINUXTYPE=targeted
重启系统。
Centos还提供了实时改变SELinux工作模式的工具,前提是SELinux没有被disabled掉的时候
/usr/sbin/setenforce 0 #使SELinux工作模式变成permissive模式
/usr/sbin/setenforce 1 #使SELinux工作模式变成enforcing模式
添加到系统默认启动脚本里面
echo "/usr/sbin/setenforce 0" >> /etc/rc.local
这样就可以实时控制SELinux的启用和不启用了。
三个参数介绍介绍
enforcing — The SELinux security policy is enforced.
permissive — The SELinux system prints warnings but does not enforce policy.
disabled — SELinux is fully disabled. SELinux hooks are disengaged from the kernel and the pseudo-file system is unregistered.
简单翻译:
enforcing模式:强制组织。
permissive模式:SELinux系统输出警告,但是不强制阻止程序运行。
disabled:
参考:http://www.centos.org/docs/5/html/Deployment_Guide-en-US/ch-selinux.html
2 #SELINUX=enforcing #注释掉
3 #SELINUXTYPE=targeted #注释掉
4 SELINUX=disabled #增加
5 :wq #保存,关闭。
6 shutdown -r now #重启系统
查看SELinux的状态:
getenforce
新安装完CentOS Linux,发现配置完apache后没法访问,估计是防火墙问题。
/etc/init.d/iptables status
会得到一系列信息,说明防火墙开着。
/etc/init.d/iptables stop
永久关闭:
chkconfig --level 35 iptables off
永久关闭SELinux
查看当前SELinux状态:
/usr/bin/setstatus -v
编辑/etc/selinux/config,找到SELINUX 行修改成为:SELINUX=disabled:
# This file controls the state of SELinux on the system.
# SELINUX= can take one of these three values:
# enforcing - SELinux security policy is enforced.
# permissive - SELinux prints warnings instead of enforcing.
# disabled - No SELinux policy is loaded.
SELINUX=disabled
# SELINUXTYPE= can take one of these two values:
# targeted - Only targeted network daemons are protected.
# strict - Full SELinux protection.
SELINUXTYPE=targeted
重启系统。
Centos还提供了实时改变SELinux工作模式的工具,前提是SELinux没有被disabled掉的时候
/usr/sbin/setenforce 0 #使SELinux工作模式变成permissive模式
/usr/sbin/setenforce 1 #使SELinux工作模式变成enforcing模式
添加到系统默认启动脚本里面
echo "/usr/sbin/setenforce 0" >> /etc/rc.local
这样就可以实时控制SELinux的启用和不启用了。
三个参数介绍介绍
enforcing — The SELinux security policy is enforced.
permissive — The SELinux system prints warnings but does not enforce policy.
disabled — SELinux is fully disabled. SELinux hooks are disengaged from the kernel and the pseudo-file system is unregistered.
简单翻译:
enforcing模式:强制组织。
permissive模式:SELinux系统输出警告,但是不强制阻止程序运行。
disabled:
参考:http://www.centos.org/docs/5/html/Deployment_Guide-en-US/ch-selinux.html
相关文章推荐
- 在CentOS 6.0下面永久关闭SELinux
- CentOS 6.6永久关闭 SELinux与防火墙 的方法
- CentOS 6.0/7.0关闭默认防火墙启用iptables防火墙
- 永久关闭防火墙和selinux
- centos7 关闭防火墙和selinux
- CentOS 6.4永久关闭SELinux
- CentOS 6.5系统中如何关闭seLinux和iptables防火墙
- CentOS 7.0关闭默认防火墙启用iptables防火墙及关闭selinux
- CentOS 7 关闭防火墙和SELinux
- rhel7的基本操作(查看IP配置,关闭防火墙,临时或永久关闭selinux,常用命 16ca 令操作)
- redhat7 centos7 关闭SELinux和防火墙的办法
- centos6.3开启和关闭以及永久关闭防火墙命令
- CentOS 关闭防火墙和SELINUX配置
- CentOS 关闭防火墙和selinux
- CentOS 7 关闭防火墙 SELinux , FireWalld
- CentOS 永久关闭防火墙
- CentOS 关闭SELINUX及添加防火墙规则
- 关闭CentOS 7 防火墙和SELinux
- CentOS 6.8 永久关闭防火墙
- CentOS 7.0 关闭防火墙和selinux