Minimal UFW Setup
UFW (Uncomplicated Firewall) is a firewall software package that is a front-end to iptables that is easy to use initially and yet flexible enough for power users.
Install UFW if it not already installed,
UFW once installed does not automatically start. First open up ports that are necessary for the administration of the system,
Additionally open other ports that you require. For this tutorial it would be,
Before starting UFW make sure you have port 22 open you can check again by running the allow 22 command again and if the rule is added should output.
After you have confirmed 22 is open you can go ahead and enable UFW.
From your desktop, use Telnet to confirm 22 port is open,
If telnet worked you should see something like this,
Finally check that all your rules are in place,
There is much more to UFW but the above steps should get you going.
You can disable or delete rules. The example shown here is two step,
Not exactly intuitive is that the delete command needs to be literal. In the above example we had "delete deny port 443". If the port was enabled and we wanted to delete in one step, the command would look like this,
To put comment
You can put comment in the rules and have it show up in the ufw status
This article can be improved in the following areas.
How I can put comments in the firewall rules and have it show up in the ufw status? Using applications.d. Will add details from here,http://manpages.ubuntu.com/manpages/jaunty/en/man8/ufw.8.html
https://help.ubuntu.com/9.10/serverguide/C/firewall.html - official docs from Ubuntu.