zoukankan      html  css  js  c++  java
  • red hat防火墙的开启与关闭及状态查看方法

    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 下的其它服务都可以用以上命令执行开启和关闭操作
     
     
  • 相关阅读:
    php switch case的"bug"
    win7 安装redis服务
    linux 查看网卡以及开启网卡
    getSelection、range 对象属性,方法理解,解释
    关于window.getSelection
    富文本原理
    elasticsearch启动常见错误
    Linux 修改用户密码
    centos修改主机名的正确方法
    Dockerfile介绍
  • 原文地址:https://www.cnblogs.com/ray-bk/p/10341227.html
Copyright © 2011-2022 走看看