CentOS   发布时间:2022-04-02  发布网站:大佬教程  code.js-code.com
大佬教程收集整理的这篇文章主要介绍了CentOS 7.0 关闭防火墙 CentOS 7.0默认使用的是firewall作为防火墙,使用iptables必须重新设置一下 1、直接关闭防火墙 sy大佬教程大佬觉得挺不错的,现在分享给大家,也给大家做个参考。

概述

        CentOS 7.0 关闭防火墙 CentOS 7.0默认使用的是firewall作为防火墙,使用iptables必须重新设置一下 1、直接关闭防火墙 systemctl stop firewalld.service #停止firewall systemctl disable firewalld.service #禁止firewall开机启动 2、设置 iptables servi

CentOS 7.0 关闭防火墙

CentOS 7.0认使用的是firewall作为防火墙,使用iptables必须重新设置一下

1、直接关闭防火墙

systemctl stop firewalld.service#停止firewall

systemctl disable firewalld.service#禁止firewall开机启动

2、设置iptables service

yum -y install iptables-services

如果要修改防火墙配置,如增加防火墙端口3306

vi /etc/sysconfig/iptables

增加规则

-A INPUT -m state --state NEW -m tcp -p tcp --dport 3306 -j ACCEPT

保存退出

systemctl restart iptables.service#重启防火墙使配置生效

systemctl enable iptables.service#设置防火墙开机启动

最后重启系统使设置生效即可。

CentOS 7 #关闭selinux

用 root 用户运行下面的命令

gedit /etc/sysconfig/selinux

#编辑 selinux 文件

打开 selinux 文件后,修改

#SELINUX=enforcing

SELINUX=disabled

保存后退出 gedit。接着再执行如下命令,注意 setenforce 后面有空格:

setenforce 0

#设置 SELinux 状态

getenforce

#获取 SELinux 状态

--------------------

[root@localhost etc]# setenforce 0

[root@localhost etc]# getenforce

Permissive

http://www.jianshu.com/p/d6414b5295b8

大佬总结

以上是大佬教程为你收集整理的CentOS 7.0 关闭防火墙 CentOS 7.0默认使用的是firewall作为防火墙,使用iptables必须重新设置一下 1、直接关闭防火墙 sy全部内容,希望文章能够帮你解决CentOS 7.0 关闭防火墙 CentOS 7.0默认使用的是firewall作为防火墙,使用iptables必须重新设置一下 1、直接关闭防火墙 sy所遇到的程序开发问题。

如果觉得大佬教程网站内容还不错,欢迎将大佬教程推荐给程序员好友。

本图文内容来源于网友网络收集整理提供,作为学习参考使用,版权属于原作者。
如您有任何意见或建议可联系处理。小编QQ:384754419,请注明来意。