centos关掉防火墙以及selinux
来源:互联网 发布:上海老年人口 知乎 编辑:程序博客网 时间:2024/05/16 17:45
SELinux 是Security-Enhanced Linux的简写。它不是用来防火墙设置的。但它对Linux系统的安全很有用。Linux内核(Kernel)从2.6就有了SELinux。
要设置防火墙,一般都是配置iptables。你如果要设置的话,可以修改/etc/sysconfig/iptables-config或者/etc/sysconfig/iptables(对后者要慎重!),但这些文件的修改要有superuser的权限。
/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
要设置防火墙,一般都是配置iptables。你如果要设置的话,可以修改/etc/sysconfig/iptables-config或者/etc/sysconfig/iptables(对后者要慎重!),但这些文件的修改要有superuser的权限。
/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
0 0
- CentOS关掉防火墙以及selinux
- centos关掉防火墙以及selinux
- centos 关闭防火墙以及关闭selinux方法
- CentOS 关闭防火墙&selinux
- Centos防火墙及SELINUX关闭
- SElinux以及防火墙的关闭
- SElinux以及防火墙的关闭
- SElinux以及防火墙的关闭
- SElinux以及防火墙的关闭
- SElinux以及防火墙的关闭
- CentOS 关闭SELINUX及添加防火墙规则
- CentOS 7 关闭防火墙 SELinux , FireWalld
- CentOS 7.0 关闭防火墙和selinux
- CentOS 关闭防火墙和SELINUX配置
- centos 6.x 关闭防火墙和selinux
- Linux 下SElinux以及防火墙的关闭
- LINUX下SElinux以及防火墙的关闭
- Linux 下SElinux以及防火墙的关闭
- zufe oj 免费的pizza (简单DP)
- HDU 5120 Intersection
- 生成Excel
- Android监听网络状态
- qml与html传参
- centos关掉防火墙以及selinux
- 网易游戏开发笔试题:lisp表达式求值
- 复习排序-冒泡排序
- Java清除session的方法
- sed 简明教程
- 《程序员面试金典》输出单层结点
- VMware 注册码
- Dev RadioGroup 用法(项横排显示、项选中)
- hibernate mysql 乱码的解决方法