Guide

Here is a quick guide on using UFW (Uncomplicated FireWall) under linux

A good first step is to do the following

sudo ufw default deny

which will set the default action to denying everything

If you are connection from remote, you will want to allow ssh otherwise it will create a nasty embarassing situation when you can’t get into your machine :)

sudo ufw allow ssh

then you can enable UFW by:

sudo ufw enable

You will now have a very basic firewall setup to deny everything except ssh. Not overly helpful if you are hosting anything else on the system. The rest of the points will be in quick
format and in the future I may update and clean up the info below