Home>Article>Operation and Maintenance> What is the command to turn off the firewall in centos?

What is the command to turn off the firewall in centos?

coldplay.xixi
coldplay.xixi Original
2021-02-24 16:59:21 60423browse

centos firewall shutdown command: 1. Temporarily shut down, the code is [systemctl stop firewalld]; 2. Disable startup, the code is [systemctl disable firewalld].

What is the command to turn off the firewall in centos?

The operating environment of this article: Windows7 system, centos6&¢os7 version, Dell G3 computer.

centos close firewall command:

CentOS6Use the following command to close the firewall,

//临时关闭 service iptables stop //禁止开机启动 chkconfig iptables off

CentOS7If you use the same command in CentOS7, an error will be reported.

stop iptables.service Failed to stop iptables.service: Unit iptables.service not loaded.

This is because the firewall uses firewalld by default after the CentOS7 version. Therefore, to turn off the firewall in CentOS7, use the following command,

//临时关闭 systemctl stop firewalld //禁止开机启动 systemctl disable firewalld Removed symlink /etc/systemd/system/multi-user.target.wants/firewalld.service. Removed symlink /etc/systemd/system/dbus-org.fedoraproject.FirewallD1.service.

Of course, if it is installediptables-service, you can also use the following command,

yum install -y iptables-services //关闭防火墙 service iptables stop Redirecting to /bin/systemctl stop iptables.service //检查防火墙状态 service iptables status Redirecting to /bin/systemctl status iptables.service 鈼iptables.service - IPv4 firewall with iptables Loaded: loaded (/usr/lib/systemd/system/iptables.service; disabled; vendor preset: disabled) Active: inactive (dead)

Related free recommendations:Programming video course

The above is the detailed content of What is the command to turn off the firewall in centos?. For more information, please follow other related articles on the PHP Chinese website!

Statement:
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn
Previous article:How to delete php on centos Next article:How to delete php on centos