Focus on cloud service provider activities
Notes on website operation and maintenance

Common command records for opening, closing, and disabling firewalls on the CentOS server

CentOS is our common server image. For example, when we install the pagoda panel, we will give priority to the CentOS system. Although CentOS7 will be banned from updating in 2024, there is no denying that this image is used more frequently in China. Considering the installation of the server, we usually set the firewall. Here we record how to turn on and off and disable the firewall when using CentOS.

The following describes CentOS commands to turn on and off firewalls.

1. Turn on the firewall

Use the following command to open the CentOS firewall:

 systemctl start firewalld

This command will start the firewalld service provided by CentOS by default and start protecting the system.

2. Turn off firewall

Use the following command to turn off the firewall of CentOS:

 systemctl stop firewalld

This command will stop the firewalld service provided by CentOS by default and stop protecting the system. Please note that your system will become more vulnerable to attacks after the firewall is turned off, so please operate with caution.

3. Disable firewall

Use the following command to disable the firewall of CentOS:

 systemctl disable firewalld

This command will disable the firewalld service provided by CentOS by default, so that it will no longer run automatically when the system starts.

4. Enable firewall

Use the following command to enable the firewall of CentOS:

 systemctl enable firewalld

This command enables the firewalld service provided by CentOS by default to run automatically when the system starts.

Summary: With the above commands, we can easily turn on, turn off, disable, and enable the CentOS firewall. When using this operating system, be sure to pay attention to network security issues and select appropriate operations as required.

Domain name host preferential information push QQ group: six hundred and twenty-seven million seven hundred and seventy-five thousand four hundred and seventy-seven Get preferential promotion from merchants.
Like( zero )
Do not reprint without permission: Lao Zuo's Notes » Common command records for opening, closing, and disabling firewalls on the CentOS server


Scan the code to follow the official account

Get more news about webmaster circle!
Entrepreneurship, operation and new knowledge