Closing of Linux Firewall

  1. View the status of the firewall

Open the terminal and enter the following command

systemctl status firewalld

As shown in the figure: running means that the firewall is currently open

Enter the command to turn off the firewall:

systemctl stop firewalld

As shown in the figure, normal users do not have permission, and they need to enter the password of the administrator to close the firewall. Then it is necessary to switch users at the terminal.

2. Switch user

Use the following command to switch to root

su root

As shown in the figure, after entering su root, and then entering the password corresponding to root, you will switch to the root user.

Explain su and root here

are:

In Linux, su is the abbreviation of "switch user", which means to switch users. The su command is used to change the identity of other users; when using this command, you need to enter the password of the user except root.

root:

Root authority, similar to Administrator in Windows system, root is a super administrator user account in Linux system, this account has the highest authority of the entire system, and can easily delete or change the components of the system.

3. Turn off the firewall

Enter the command to turn off the firewall:

systemctl stop firewalld

Then enter the following command to view the status of the firewall. As shown in the figure above, the firewall processes the dead state, which means it is closed.

systemctl status firewalld

4. Permanently turn off the firewall

The above-mentioned shutdown of the firewall is temporary. After restarting the virtual machine, the firewall is automatically turned on again. Then we can use the following command to turn off the firewall as needed:

systemctl disable firewalld

Guess you like

Origin blog.csdn.net/weixin_42218169/article/details/129498581