本文将简单介绍在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,重启生效。

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. CSAPP lab2 二进制拆弹 binary bombs phase_5

    给出对应于7个阶段的7篇博客 phase_1  https://www.cnblogs.com/wkfvawl/p/10632044.htmlphase_2  https://www.cnblogs. ...

  2. process.tar.gz

    exec1.c #include <stdio.h> #include <unistd.h> int main() { char *arglist[3]; arglist[0] ...

  3. Alpha版本总结

    Alpha版本总结 General Questions a)     What went well?  Why? 成功之处:界面设计简洁,功能吸引用户. 原因:铁道大学学生上自习不方便,没有固定的教室 ...

  4. Android的发展历程及搭建

    Android的发展历程: 对于Android我比较不熟悉,因为我的第一只手机就是iphone,我没用过Android系统,但在中国使用带有Android系统的手机的人数是最多的,所以我想学习Andr ...

  5. python自定义mininet拓扑

    python自定义mininet拓扑 前言 闲来无聊,想到很早之前都是用GUI来自定义拓扑,这次用python来自定义一下(以前留下的苦果) 转自Mininet 自定义网络拓扑 过程相对简单 实现过程 ...

  6. Bean的加载

    ClassPathXmlApplicationContext存储内容 为了更理解ApplicationContext,拿一个实例ClassPathXmlApplicationContext举例,看一下 ...

  7. robotframework运行时后台报错UnicodeDecodeError

    win10环境下报错: Traceback (most recent call last): File "C:\Python27\lib\site-packages\robotide\con ...

  8. BZOJ5461 PKUWC2018Minimax(概率期望+线段树合并+动态规划)

    离散化后,容易想到设f[i][j]为i节点权值为j的概率,不妨设j权值在左子树,则有f[i][j]=f[lson][j](pi·f[rson][1~j]+(1-pi)·f[rson][j~m]). 考 ...

  9. css后代选择器 .属性 元素 与 元素.属性的区别

    经常看见css的后代选择器是这样的写法: div.class   和 .class div 的形式两者的区别: div.class  是选中的类名为class 的div元素,与直接使用类选择器.cla ...

  10. 【BZOJ4888】[TJOI2017]异或和(树状数组)

    [BZOJ4888][TJOI2017]异或和(树状数组) 题面 BZOJ 洛谷 题解 考虑每个位置上的答案,分类讨论这一位是否存在一,值域树状数组维护即可. #include<iostream ...