Linux禁用防火墙规则的命令_linux 防火墙开启端口

大家好,又见面了,我是你们的朋友全君。

有时候linux防火墙会让人觉得很烦人,想暂时禁用它吗?别担心,学习啦小编将为您详细介绍如何禁用Linux防火墙,希望对您有所帮助!

Linux防火墙禁用方法一:

Linux系统主要有两种管理服务的软件:

大多数发行版采用SysV init的系统启动进程管理体系,通过service和chkconfig命令来配置和控制服务,例如centos 6。

而一些发行版则默认使用较新的也是颇具争议的systemd体系,例如CentOS 7。

对于CentOS 6:

  • 启动防火墙:service iptables start
  • 关闭防火墙:service iptables stop
  • 禁止防火墙开机启动:chkconfig iptables off

对于CentOS 7:

  • 启动防火墙:systemctl start firewalld.service
  • 关闭防火墙:systemctl stop firewalld.service
  • 禁止防火墙开机启动:systemctl disable firewalld.service

Linux防火墙禁用方法二:

Linux禁用防火墙规则的命令_linux 防火墙开启端口

查看防火墙状态:

# service iptables status

关闭防火墙:

# service iptables stop

Linux防火墙禁用方法三:

关闭iptables:

# service iptables stop # 关闭iptables服务 # chkconfig iptables off # 开机不启动

调整selinux状态:

# setenforce 0 # 调整到宽松模式 # vim /etc/selinux/config SELINUX=disabled # 以后开机selinux都禁用

发布者:全栈程序员栈长,转载请注明出处:https://www.php.cn/link/74b72ae2ee96f9be8900a13e80fb63ac 原文链接:https://www.php.cn/link/c8377ad2a50fb65de28b11cfc628d75c

© 版权声明
THE END
喜欢就支持一下吧
点赞7 分享