Centos7关闭防火墙和selinux

1、关闭防火墙

1.1、查看防火墙状态

  [root@localhost ~]# systemctl status firewalld

  

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

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

1.2、关闭防火墙

  [root@localhost ~]# systemctl stop firewalld

1.3、关闭开机自启动

  [root@localhost ~]# systemctl disable firewalld

  

2、关闭selinux

1.1、getenforce 查看SELinux的状态,如下(默认开启,Enforceing)

  

1.2、关闭SELinux

  vi /etc/selinux/config

  把SELINUX的值设为disabled

  

原文地址:https://www.cnblogs.com/snooker/p/9223097.html