February 2020
Intermediate to advanced
666 pages
15h 45m
English
On Ubuntu 18.04 and later, the ufw systems service is already enabled by default, but is isn't activated. In other words, the system's service is running, but it isn't enforcing any firewall rules yet. (I'll show you how to activate it in just a bit, after we go over how to open the ports that you need to open.) On other Linux distros, such as the older Ubuntu 16.04, you might find that ufw is disabled by default. If that's the case, you'll need to enable it, like so:
sudo systemctl enable --now ufw
The first thing we want to do is open port 22 to allow it to connect to the machine via Secure Shell, like so:
sudo ufw allow 22/tcp
By using sudo iptables -L, you'll see that the new rule shows up in the ufw-user-input chain: ...