To disable the firewall service on Linux: Use the command "sudo ufw disable" to disable the UFW service. Use "sudo ufw status" to verify the disabled status. To allow a specific port, use "sudo ufw allow [port]/tcp" before disabling it. Optionally, use "sudo ufw enable" to re-enable the firewall.
How to disable the firewall service on Linux
The firewall service in a Linux system is usually provided by UFW (Uncomplicated Firewall) Management, which provides a simple and easy-to-use interface to manage firewall rules. To turn off the UFW firewall service, perform the following steps:
Step 1: Disable the UFW service
sudo ufw disable
This command will disable the UFW firewall service. If prompted for a password, type the sudo password and press Enter.
Step 2: Verify Firewall Status
After disabling the service, verify the firewall status using the following command:
sudo ufw status
The output should show:
Status: inactive
This indicates that the firewall service is disabled.
Step 3: Allow specific ports
If you need to allow access to specific ports, add a rule before disabling the firewall service. For example, to allow port 80 (HTTP traffic):
sudo ufw allow 80/tcp
Step 4: Re-enable the firewall (optional)
If you need to re-enable the firewall, type the following command :
sudo ufw enable
This will re-enable the UFW firewall service and apply any configured rules.
The above is the detailed content of How to turn off the firewall service in Linux. For more information, please follow other related articles on the PHP Chinese website!