


In that case, only allow ssh access from the static IP address such as 202.54.2.5 to Ubuntu server IP address 172.24.13.45: Some sysadmins have a static IP address (such as 202.54.2.5) at home or office location. If you are running ssh on TCP port 2222 or TCP port 2323, enter: We can easily open SSH TCP port 22 using UFW as follows: The next logical step is to allow incoming SSH ports. $ cat /etc/default/ufw Step 2 – Open SSH TCP port 22 connections Make sure the directive IPV6=yes do exists in /etc/default/ufw file. $ sudo ufw default deny incoming Enabling IPv6 support Let us block all incoming connection and only allow outgoing connections from the Ubuntu 20.04 LTS box:

It is always a good policy to closes all ports on the server and open only required ports one by one. The default policy firewall works out great for both the servers and desktop.
