当前位置:柔美女性网 >

绿色生活 >心理 >

redhat查看防火墙是否开启

redhat查看防火墙是否开启

redhat查看防火墙是否开启

Redhat使用了SELinux来增强安全

首先怎么查看防火墙的状态呢

a.可以通过如下命令查看iptables防火墙状态:

chkconfig --list iptables

b. selinux状态可以通过以下命令查看:

sestatus或者/usr/sbin/sestatus [-v]

selinux关闭的办法为:

1、 永久有效

修改 /etc/selinux/config 文件中的 SELINUX="enforcing" ,设置为 disabled ,然后重启系统。

也可以在/etc/sysconfig/selinux中配置SELINUX=disabled,来关闭selinux,然后重启系统。

2、 即时生效

setenforce 0 ---不需要重启系统,但是临时的。其中,0表示设置SELinux 成为permissive模式,1表示设置SELinux 成为enforcing模式

关闭防火墙的方法为:

1、 永久性生效

开启:chkconfig iptables on

chkconfig ip6tables off ---针对ipv6

关闭:chkconfig iptables off

chkconfig ip6tables off ---针对ipv6

2、 即时生效,重启后失效

开启:service iptables start

关闭:service iptables stop

补充:

需要说明的是对于 Linux 下的其它服务都可以用以上命令执行开启和关闭操作

标签: 查看 redhat 防火墙
  • 文章版权属于文章作者所有,转载请注明 https://rmnxw.com/lvse/xinli/orxp6j.html