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

关闭防火墙

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

关闭Selinux

  1. 查看selinux状态
  2. [root@localhost ~]# getenforce
  3. Enforcing
  4.  
  5. 临时关闭selinux
  6. [root@localhost ~]# setenforce 0
  7. [root@localhost ~]# getenforce
  8. Permissive
  9.  
  10. 永久关闭|禁止开机启动
  11. 进入到/etc/selinux/config文件
  12. vim /etc/selinux/config
  13. SELINUX=enforcing改为SELINUX=disabled,重启生效。

CentOS7 关闭防火墙和selinux的更多相关文章

  1. Centos7关闭防火墙与selinux

    CentOS 7.0默认使用的是firewall作为防火墙 直接关闭防火墙 systemctl stop firewalld.service #停止firewall systemctl disable ...

  2. CentOS7关闭防火墙和selinux

    直接上命令 在root用户下 systemctl stop firewalld systemctl disable firewalld systemctl status firewalld vi /e ...

  3. centos7 关闭防火墙

    centos7 关闭防火墙 1.firewall相关的操作    查看防火墙状态 firewall-cmd    --state 关闭防火墙 systemctl  stop   firewalld.s ...

  4. CentOS 关闭防火墙和selinux

    1)关闭防火墙(每个节点) [Bash shell] 1 2 service iptables stop chkconfig iptables off 2)关闭selinux(重启生效) [Bash ...

  5. Linux关闭防火墙、SELinux

    使用root权限: Linux关闭防火墙: 1. chkconfig –list|grep iptables 2. chkconfig iptables off 永久关闭防火墙 3. chkconfi ...

  6. 永久关闭防火墙和selinux

    临时关闭selinux: setenforce 0    //设置SELinux 成为permissive模式 彻底禁用selinux: 使用root用户,vim /etc/sysconfig/sel ...

  7. [RHEL7.1]关闭防火墙及SElinux

    一.关闭防火墙 1. 先查看防火墙状态 [root@bogon ~]# 1 systemctl status firewalld firewalld.service - firewalld - dyn ...

  8. CentOS7 关闭防火墙[转]

    CentOS6关闭防火墙使用以下命令, /临时关闭 service iptables stop //禁止开机启动 chkconfig iptables off CentOS7中若使用同样的命令会报错, ...

  9. centOS7关闭防火墙的命令

    centOS7下关闭防火墙的命令已经改了,如下:      systemctl stop firewalld

随机推荐

  1. 《Linux内核分析》第二周笔记 操作系统是如何工作的

    操作系统是如何工作的 一.函数调用堆栈 1.三个法宝 计算机是如何工作的?(总结)——三个法宝(存储程序计算机.函数调用堆栈.中断机制) 1)存储程序计算机工作模型,计算机系统最最基础性的逻辑结构: ...

  2. 《Linux内核--分析Linux内核创建一个新进程的过程 》 20135311傅冬菁

    20135311傅冬菁 分析Linux内核创建一个新进程的过程 一.学习内容 进程控制块——PCB  task_struct数据结构 PCB task_struct中包含: 进程状态.进程打开的文件. ...

  3. C#使用结构体,输入5个人的学号,姓名,分数,按照成绩高低排列打印出来

    using System; using System.Collections.Generic; using System.Linq; using System.Text; using System.T ...

  4. 在PHPStorm中快速插入当前日期

    在EditPlus中使用快捷键Ctrl+D即可插入当前日期,但在PHPStorm中似乎没有这样的快捷键,那如何实现快速插入当前日期呢?其实很简单,跟我做一遍你就会了: 目标 为PHPStorm定义一个 ...

  5. 【刷题】LOJ 6003 「网络流 24 题」魔术球

    题目描述 假设有 \(n\) 根柱子,现要按下述规则在这 \(n\) 根柱子中依次放入编号为 \(1, 2, 3, 4, \cdots\) 的球. 每次只能在某根柱子的最上面放球. 在同一根柱子中,任 ...

  6. 学习Spring Boot:(十三)配置 Shiro 权限认证

    经过前面学习 Apache Shiro ,现在结合 Spring Boot 使用在项目里,进行相关配置. 正文 添加依赖 在 pom.xml 文件中添加 shiro-spring 的依赖: <d ...

  7. 【BZOJ2563】阿狸和桃子的游戏(贪心)

    [BZOJ2563]阿狸和桃子的游戏(贪心) 题面 BZOJ 题解 边权平均分给两个点就好了. #include<iostream> #include<cstdio> #inc ...

  8. 【Luogu P4074】[WC2013]糖果公园(树上带修改莫队)

    题目描述 Candyland 有一座糖果公园,公园里不仅有美丽的风景.好玩的游乐项目,还有许多免费糖果的发放点,这引来了许多贪吃的小朋友来糖果公园游玩. 糖果公园的结构十分奇特,它由 \(n\) 个游 ...

  9. 51nod1134——(最长上升子序列)

    给出长度为N的数组,找出这个数组的最长递增子序列.(递增子序列是指,子序列的元素是递增的) 例如:5 1 6 8 2 4 5 10,最长递增子序列是1 2 4 5 10.   Input 第1行:1个 ...

  10. JavaScript学习复习

    JavaScript 输出 使用 window.alert() 弹出警告框. 使用 document.write() 方法将内容写到 HTML 文档中. 使用 innerHTML 写入到 HTML 元 ...