zoukankan      html  css  js  c++  java
  • CentOS7 关闭防火墙和selinux

      本文将简单介绍在CentOS7上如何临时和永久关闭防火墙和selinux。

    关闭防火墙

    # 查看防火墙状态
    [root@localhost ~]# systemctl status firewalld.service
    ● firewalld.service - firewalld - dynamic firewall daemon
       Loaded: loaded (/usr/lib/systemd/system/firewalld.service; disabled; vendor preset: enabled)
       Active: active (running) since 二 2019-03-26 19:21:11 CST; 3 weeks 0 days ago
     Main PID: 907 (firewalld)
       CGroup: /system.slice/firewalld.service
               └─907 /usr/bin/python -Es /usr/sbin/firewalld --nofork --nopid
    
    3月 26 19:21:10 localhost.localdomain systemd[1]: Starting firewalld - dynam...
    3月 26 19:21:11 localhost.localdomain systemd[1]: Started firewalld - dynami...
    Hint: Some lines were ellipsized, use -l to show in full.
    
    # 临时关闭防火墙
    [root@localhost ~]# systemctl stop firewalld.service
    
    # 禁止防火墙开机启动,永久关闭
    [root@localhost 桌面]# systemctl disable firewalld.service
    Removed symlink /etc/systemd/system/dbus-org.fedoraproject.FirewallD1.service.
    Removed symlink /etc/systemd/system/basic.target.wants/firewalld.service.

    关闭Selinux

    查看selinux状态
    [root@localhost ~]# getenforce
    Enforcing
    
    临时关闭selinux
    [root@localhost ~]# setenforce 0
    [root@localhost ~]# getenforce
    Permissive
    
    永久关闭|禁止开机启动
    进入到/etc/selinux/config文件
    vim /etc/selinux/config
    将SELINUX=enforcing改为SELINUX=disabled,重启生效。
  • 相关阅读:
    Java面试题 OOAD & UML+XML+SQL+JDBC & Hibernate
    Java面试题 corejava(二)
    Java面试题 corejava(一)
    Java 笔试题(一)
    大数据离线分析平台 用户数据Etl
    Spfa【p1186】 玛丽卡
    牛客nowcoder Noip提高组第四场
    分层图【p4568】 [JLOI2011]飞行路线
    10.06 国庆节第九场模拟赛
    10.04 国庆节第七场模拟赛
  • 原文地址:https://www.cnblogs.com/Hi-blog/p/How-To-Disable-Firewall-And-Selinux-On-CentOS7.html
Copyright © 2011-2022 走看看