zoukankan      html  css  js  c++  java
  • [RHEL7.1]关闭防火墙及SElinux

    一、关闭防火墙

    1. 先查看防火墙状态

    [root@bogon ~]#

    1
    systemctl status firewalld

    firewalld.service - firewalld - dynamic firewall daemon

       Loaded: loaded (/usr/lib/systemd/system/firewalld.service; enabled)

       Active: active (running) since 一 2015-05-25 22:53:54 CST; 3min 18s ago

     Main PID: 979 (firewalld)

       CGroup: /system.slice/firewalld.service

               └─979 /usr/bin/python -Es /usr/sbin/firewalld --nofork --nopid

    5月 25 22:53:54 localhost.localdomain systemd[1]: Started firewalld - dynami...

    Hint: Some lines were ellipsized, use -l to show in full.

    2. 关闭防火墙

    [root@bogon ~]#

    1
    systemctl stop firewalld

    [root@bogon ~]#

    1
    systemctl status firewalld

    firewalld.service - firewalld - dynamic firewall daemon

       Loaded: loaded (/usr/lib/systemd/system/firewalld.service; enabled)

       Active: inactive (dead) since 一 2015-05-25 23:03:56 CST; 3s ago

      Process: 979 ExecStart=/usr/sbin/firewalld --nofork --nopid $FIREWALLD_ARGS (code=exited, status=0/SUCCESS)

     Main PID: 979 (code=exited, status=0/SUCCESS)

    5月 25 22:53:54 localhost.localdomain systemd[1]: Started firewalld - dynami...

    5月 25 23:03:55 bogon systemd[1]: Stopping firewalld - dynamic firewall da.....

    5月 25 23:03:56 bogon systemd[1]: Stopped firewalld - dynamic firewall daemon.

    Hint: Some lines were ellipsized, use -l to show in full.

    3. 查看防火墙服务是否开机启动

    [root@bogon ~]#

    1
    systemctl is-enabled firewalld

    enabled  #开启

    4. 关闭防火墙开机启动

    [root@bogon ~]#

    1
    systemctl disable firewalld

    rm '/etc/systemd/system/dbus-org.fedoraproject.FirewallD1.service'

    rm '/etc/systemd/system/basic.target.wants/firewalld.service'

    [root@bogon ~]#

    1
    systemctl is-enabled firewalld

    disabled

    二、关闭SELinux

    1. 查看当前SELinux状态

    [root@bogon ~]#

    1
    getenforce

    Enforcing

    2. 关闭SElinux

    [root@bogon ~]#

    1
    setenforce 0

    [root@bogon ~]# getenforce

    Permissive

    3. 编辑配置文件

    [root@bogon ~]#

    1
    vim /etc/selinux/config

    # 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=permissive    #修改此参数

    # SELINUXTYPE= can take one of three two values:

    #     targeted - Targeted processes are protected,

    #     minimum - Modification of targeted policy. Only selected processes are protected. 

    #     mls - Multi Level Security protection.

    SELINUXTYPE=targeted

  • 相关阅读:
    为富人服务,挣富人的钱 Leone
    javascript 高效数组随机顺序 Leone
    Atitit 开发2d游戏的技术选型attilax总结
    Atitit 软件项目非法模块与功能的管理与  监狱管理的对比 原理与概论attilax总结
    qqzoneQQ空间漏洞扫描器的设计attilax总结
    Atitit机器学习原理与概论book attilax总结
    Atiti  qq空间破解(3)gui图形化通用cli执行器atiuse
    Atitit.attilax重要案例 项目与解决方案与成果 v6 qa15
    Atitit dsl对于数组的处理以及main函数的参数赋值
    Atitit 类库冲突解决方案  httpclient4.5.2.jar
  • 原文地址:https://www.cnblogs.com/hanson1/p/7105315.html
Copyright © 2011-2022 走看看