CentOS 7.5关闭FireWall 和SELinux图文详解

1. 环境

CentOS 7.5

2. 关闭FireWall和SELinux

2.1 FireWall

使用systemctl status firewalld查看防火墙的状态,如下(默认开启)

[linuxidc@localhost ~]$ systemctl status firewalld

// 防火墙状态
● firewalld.service - firewalld - dynamic firewall daemon
  Loaded: loaded (/usr/lib/systemd/system/firewalld.service; enabled; vendor preset: enabled)
  Active: active (running) since 二 2018-11-13 14:40:53 CST; 11min ago
    Docs: man:firewalld(1)
 Main PID: 821 (firewalld)
    Tasks: 2
  CGroup: /system.slice/firewalld.service
          └─821 /usr/bin/Python -Es /usr/sbin/firewalld --nofork --nopid

11月 13 14:40:51 localhost.localdomain systemd[1]: Starting firewalld - dyna...
11月 13 14:40:53 localhost.localdomain systemd[1]: Started firewalld - dynam...
Hint: Some lines were ellipsized, use -l to show in full.

如果你需要使用FireWall服务(正式环境下),则需要修改它的配置,因为在默认情况下,它会拦截大多数服务请求。具体可以参考配置firewalld服务的基本操作和设置。

如果由于某些原因(比如本文只是需要Linux服务器来搭建某些服务,不想控制防火墙只开放某些端口)等而不需要FireWall服务,则可以像下面那样停止并禁用它。

// 关闭服务
[linuxidc@localhost ~]$ systemctl stop firewalld

// 关闭开机自动开启FireWall服务
[linuxidc@localhost ~]$ systemctl disable firewalld 
Removed symlink /etc/systemd/system/multi-user.target.wants/firewalld.service.
Removed symlink /etc/systemd/system/dbus-org.Fedoraproject.FirewallD1.service.

2.2 关闭SELinux

可以用getenforce 查看SELinux的状态,如下(默认开启)

[linuxidc@localhost ~]$ getenforce

//开启状态
Enforcing

同上,如果你想使用SELinux也可以。但是本人不想那么麻烦,所以把SELinux也关闭了。

[linuxidc@localhost ~]$ sudo nano /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.

// 这里改变为disabled
SELINUX=disabled
# 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

// 重启使配置生效
[linuxidc@localhost ~]# reboot

CentOS 7.5关闭FireWall 和SELinux图文详解的更多相关文章

  1. Git学习系列之CentOS上安装Git详细步骤(图文详解)

    前言 最早Git是在Linux上开发的,很长一段时间内,Git也只能在Linux和Unix系统上跑.不过,慢慢地有人把它移植到了Windows上.现在,Git可以在Linux.Unix.Mac和Win ...

  2. CentOS命令行界面与图形界面切换(图文详解)

    不多说,直接上干货! Ctrl + Alt +F1,到图形界面 Ctrl + Alt +F2,到命令行界面 欢迎大家,加入我的微信公众号:大数据躺过的坑        人工智能躺过的坑       同 ...

  3. 全网最详细的Windows里Git client客户端管理工具SourceTree的下载与安装(图文详解)

    不多说,直接上干货! 很多人用Git命令行不熟练,那么可以尝试使用SourceTree进行操作. 安装之前的必备    (1)Git的安装 Git学习系列之Windows上安装Git详细步骤(图文详解 ...

  4. Git学习系列之Windows上安装Git详细步骤(图文详解)

    前言 最初,Git是用于Linux下的内核代码管理.因为其非常好用,目前,已经被成功移植到Mac和Windows操作系统下. 鉴于大部分使用者使用的是Windows操作系统,故,这里详细讲解Windo ...

  5. Windows环境下执行hadoop命令出现Error: JAVA_HOME is incorrectly set Please update D:\SoftWare\hadoop-2.6.0\conf\hadoop-env.cmd错误的解决办法(图文详解)

    不多说,直接上干货! 导读   win下安装hadoop 大家,别小看win下的安装大数据组件和使用  玩过dubbo和disconf的朋友们,都知道,在win下安装zookeeper是经常的事   ...

  6. CentOS 6.3下Samba服务器的安装与配置方法(图文详解)

    这篇文章主要介绍了CentOS 6.3下Samba服务器的安装与配置方法(图文详解),需要的朋友可以参考下   一.简介  Samba是一个能让Linux系统应用Microsoft网络通讯协议的软件, ...

  7. (转)CentOS系统启动流程图文详解

    CentOS系统启动流程图文详解. 原文:http://www.linuxidc.com/Linux/2017-03/141966.htm 熟悉系统启动流程对于我们学习Linux系统是非常有帮助的,虽 ...

  8. (转)CentOS 6下配置软RAID图文详解

    CentOS 6下配置软RAID图文详解 原文:http://blog.51cto.com/hujiangtao/1929620 一.RAID 简介 RAID 是英文Redundant Array o ...

  9. Linux虚拟机安装(CentOS 6.5,图文详解,需要自查)

    Linux虚拟机的安装(图文详解) 下篇会接续Hadoop集群安装(以此为基础) 一.安装准备 VMWorkstation.linux系统镜像(以下以CentOS6.5为例) 二.安装过程详解 关闭防 ...

随机推荐

  1. 长时间不操作Navicat或Putty会断线?

    问题描述 今天发现只要一直不使用Putty,发现就会"卡住",还有Navicat连接数据库也有类似问题. 问题分析 Linux或者数据库都想节省连接资源呗. 问题解决 那就隔一段时 ...

  2. uniap tab list 滑动

    效果如下 <uni-popup ref="bankListAll" type="dialog"> <ty-mutiple-select :mu ...

  3. vue element InfiniteScroll 无限滚动 入坑记录

    select_law_by_tag() { this.laws_loading.is_loading = true; this.laws_loading.no_more = false; this.e ...

  4. python基础——异常处理、递归

    异常处理 while True: try: num1 = int(input('num1:')) num2 = int(input('num2:')) result = num1 + num2 exc ...

  5. Java中File类的方法详解

    File类也是Java中一个比较重要的类,通过他我们可以实现对文件的一系列操作,其内置了很多方法,下面我将按方法的功能分块,逐一讲解: 快速导航 构造方法 常用方法 创建目录 判断 `is...` t ...

  6. Sublime Python3编译环境修改

    http://blog.csdn.net/qq_33304418/article/details/63337602     添加编译环境python3.6 Tools -> Build Syst ...

  7. 虫师Selenium2+Python_2、测试环境搭建

    windows环境配置: 步骤: 安装python 官网下载http://www.seleniumhq.org/ https://www.python.org/downloads/windows/ 3 ...

  8. iceberg合并小文件冲突测试

    基于iceberg的master分支的9b6b5e0d2(2022-2-9). 参数说明 1.PARTIAL_PROGRESS_ENABLED(partial-progress.enabled) 默认 ...

  9. 解决:阿里云服务器被植入挖矿程序后修改密码失败的问题(报错:passwd: Authentication token manipulation error)

    如下图,在修改密码的时候会报错 原因: 通常不能修改密码都是/etc/passwd文件或者/etc/shadow文件被锁住了 解决: 检查/etc/passwd文件和/etc/shadow文件是否被锁 ...

  10. react中配置路由

    一个路由就是一个通道,页面之间的跳转其实就是路由的切换,所以每个应用的路由配置是必须的,浅谈react中怎么配置路由 首先你要在src文件夹下新建一个router的文件下,在router文件下新建一个 ...