首页 > 系统相关 >linux 关闭防火墙firewall,centos中关闭防火墙(firewall)及SELinux

linux 关闭防火墙firewall,centos中关闭防火墙(firewall)及SELinux

时间:2023-01-12 11:14:36浏览次数:55  
标签:iptables centos service firewall 防火墙 关闭

https://blog.csdn.net/weixin_30983965/article/details/116864967

centos在不断的版本更新迭代过程中,在centos7中默认使用的是firewall作为防火墙。

centos7关闭firewall

查看运行状态:firewall-cmd --state

临时停止:systemctl stop firewalld.service

启动:systemctl start firewalld.service

禁止防火墙开机启动,永久关闭:systemctl disable firewalld.service

centos6 关闭iptables

安装:yum install -y iptables-services

如果centos7也安装了iptables-services,也可以使用以下命令来关闭防火墙

1) 即时生效,重启后复原

开启: service iptables start

关闭: service iptables stop

状态: service iptables status

2) 永久性生效,重启后不会复原

开启: chkconfig iptables on

关闭: chkconfig iptables off

3)正确关闭步骤:

service iptables stop

chkconfig iptables off

SELinux关闭

查看命令1:getenforce

查看命令2:/usr/sbin/sestatus -v

当返回结果为Disabled时,为关闭状态

临时关闭:setenforce 0

永久关闭:vim /etc/selinux/config

将SELINUX=enforcing更改为SELINUX=disabled

设置后需要重启机器后才能生效。

标签:iptables,centos,service,firewall,防火墙,关闭
From: https://www.cnblogs.com/zhoading/p/17045853.html

相关文章

  • Ubuntu设置UFW (防火墙)
    开启关闭防火墙sudoufwenable#开启防火墙sudoufwdisable#关闭防火墙查看防火墙状态sudoufwstatus开启防火墙端口/服务1.开发端口sudoufwallow33......
  • Win10\Winser2019关闭驱动数字签名方法
    原帖:https://blog.csdn.net/inthat/article/details/124969099方案一:临时禁用驱动数字签名强制,方法:https://jingyan.baidu.com/article/624e74594dbc8d34e8ba5aa6.html通......
  • Python程序执行shell命令并关闭进程-总结
    需求说明linux下,有时候我们用Python3执行一个shell命令,这会开启一个进程。但是这个进程可能能不会主动关闭(比如Linux下的ping指令会一直持续执行),我们希望这个进程执行指......
  • Swoole 短名未关闭
    ​​[ERROR]Swooleshortnamehavetodisablebeforestartserver,pleasesetswoole.use_shortname='Off'intoyourphp.ini.​​您需要在您的php.ini配置文件......
  • LSI系列RAID卡下PR和CC关闭方案
    LSI系列RAID卡下PR和CC关闭方案判断是否使用LSI阵列卡本文档仅提供了H3C服务器中RAID卡型号判断方法,如果使用其他服务器,请联系第三方厂家进行确认。方法1:在HDM界面进行判断......
  • STM32HAL库定时器中断关闭的方法
    本文可以用于解决这个问题:定时器中断上电后莫名其妙开启,或者首先触发一次。STM32HAL库在定时器初始化并开启以后,也是会默认开启中断。如不需要默认就开启中断可以用一下代......
  • 防火墙配置
    防火墙开放指定端口查看某个端口是否打开firewall-cmd--query-port=3306/tcp开放5672端口firewall-cmd--zone=public--add-port=5672/tcp--permanent关闭567......
  • Google Cloud Platform | 使用 Terraform 的分层防火墙策略自动化
    【本文由CloudAce整理发布,更多内容请访问CloudAce官网】防火墙规则是GoogleCloud中网络安全的重要组成部分。GoogleCloud中的防火墙大致可分为两种类型;网络防火墙......
  • Antd弹窗无法关闭 也没有动画
    Antd弹窗用方法调用后没有动画且无法关闭constmodal=Modal.info({content:<Tablecolumns={columns}size="small"bordereddataSource={fields}pagination={fa......
  • 阿里云云服务器开启了防火墙导致无法远程连接
    1、问题描述:   2、解决方法:使用阿里云官网中的控制台中的远程连接(VNC)......