To open a firewall port in Ubuntu, you need to use the
ufw (Uncomplicated Firewall) command line tool. Here are the steps to open a port in Ubuntu using
- Open a terminal window by pressing CTRL + ALT + T on your keyboard.
- Type the following command to list the current status of your firewall:
- If your firewall is inactive, you can enable it by typing the following command:
- To open a port, you can use the following syntax:
sudo ufw allow <port number>/<protocol>
For example, to open port 80 for HTTP traffic, you can use the following command:
- You can verify that the port has been opened by typing the following command:
This will show you a list of the current firewall rules, including the rule you just added to open the port.