banner
xingli

xingli

猫娘爱好者

ufw Firewall Tutorial

ufw Firewall Tutorial#

Uninstall the package using apt-get --purge remove package name

Ubuntu Firewall#

You can enable UFW on Linux by following these steps:

  1. First, check if UFW is installed. Enter the following command in the terminal:

sudo ufw status

If it prompts "command not found," it means UFW is not installed on this system. You need to execute the following command to install UFW:

sudo apt-get install ufw

  1. To activate UFW, set the default UFW policies to deny:

sudo ufw default deny incoming

sudo ufw default allow outgoing

  1. Open the necessary ports. For example, open SSH port 22 (modify as needed):

sudo ufw allow 22/tcp

  1. Finally, enable UFW and check the status:

sudo ufw enable

sudo ufw status

If you see "Status: active" in the output, it means UFW has been successfully enabled.

Resolving Port Occupancy#

  1. Enter the following command to view all service ports and display the PID number.

To stop this process, you can use the kill command.

To view port 8080, you can use the grep command:

To view port 8888, enter the following command in the terminal:

Loading...
Ownership of this post data is guaranteed by blockchain and smart contracts to the creator alone.