How to open ssh 22/TCP port using ufw on Ubuntu/Debian Linux

‮/:sptth‬/www.lautturi.com
How to open ssh 22/TCP port using ufw on Ubuntu/Debian Linux

The Uncomplicated Firewall (UFW) is a frontend for the Linux firewall that makes it easy to manage the firewall rules on an Ubuntu or Debian Linux system. To open the SSH 22/TCP port using UFW on an Ubuntu or Debian Linux system, you can follow these steps:

  1. Open a terminal window on the Ubuntu or Debian system.

  2. Check the status of the UFW firewall by running the following command:

sudo ufw status

This command will display the current status of the UFW firewall, including any rules that are currently in place.

  1. If the UFW firewall is not currently enabled, enable it by running the following command:
sudo ufw enable

This command will enable the UFW firewall and start enforcing the firewall rules.

  1. To allow incoming SSH connections on the 22/TCP port, run the following command:
sudo ufw allow 22/tcp

This command will add a rule to the UFW firewall that allows incoming connections on the 22/TCP port.

  1. To check the UFW rules again, run the following command:
sudo ufw status

This command should display the new rule that allows incoming connections on the 22/TCP port.

  1. If you want to delete a UFW rule, you can use the ufw delete command. For example, to delete the rule that allows incoming connections on the 22/TCP port, run the following command:
sudo ufw delete allow 22/tcp

By following these steps, you can use the UFW firewall to open the SSH 22/TCP port on an Ubuntu or Debian Linux system. For more information on how to use the UFW firewall on an Ubuntu or Debian Linux system, you can refer to the UFW documentation or the Linux documentation.

Created Time:2017-10-28 21:39:06  Author:lautturi