小鱼儿博客

RedHat Linux关闭防火墙的命令

Redhat使用了SELinux来增强安全,关闭的办法为:

第一种方法

1. 永久有效
修改 /etc/selinux/config 文件中的 SELINUX="" 为 disabled ,然后重启。
2. 即时生效
setenforce 0
关闭防火墙的方法为:
1. 永久性生效
开启:chkconfig iptables on
关闭:chkconfig iptables off
2. 即时生效,重启后失效
开启:service iptables start
关闭:service iptables stop
需要说明的是对于 Linux 下的其它服务都可以用以上命令执行开启和关闭操作
补充:
a. 防火墙还需要关闭ipv6的防火墙:
chkconfig ip6tables off
并且可以通过如下命令查看状态:
chkconfig --list iptables
b. selinux状态可以通过以下命令查看:
sestatus

第二种方法

获得root 控制权限。在“#”下操作。

查看防火墙状态。
systemctl status firewalld

临时关闭防火墙命令。重启电脑后,防火墙自动起来。
systemctl stop firewalld

永久关闭防火墙命令。重启后,防火墙不会自动启动。
systemctl disable firewalld

打开防火墙命令。
systemctl enable firewalld

0

用户头像
  
博客所属
博主:liuzz | 小鱼儿
个人: 属鼠 水瓶座
故乡:河北 秦皇岛
现居:中国 北京
职业:IT码农
主页:http://www.liuzz.com
喜欢: 看海、台球
我的简历:My Resume
联系博主
369264776
jun-yuhong#163.com
说点什么 ×