Lockdown Server with Firewall

A firewall creates a barrier between your computer and the rest of the world when connected to the internet or a network. Sys Admins are pros at customizing firewalls - knowing what ports to block or leave open, to protect and use their servers.

firewalls

Let's install a firewall on our Ubuntu server, called Uncomplicated Firewall, and set a few options. In Terminal:

sudo apt-get ufw

ufw settings

Now, for the settings. By default deny access to ports:

sudo ufw default deny

Turn on logging so you can keep track of the firewall's history:

sudo ufw logging on

Allow 80/tcp connections which are standard http:// web requests, so that you can host websites:

sudo ufw allow 80/tcp

Allow access to port 22, the default SSH port, so that you can access your server from other places:

sudo ufw allow 22

Turn the firewall on:

sudo ufw enable

Finally, check the status to verify your settings are as you want them:

sudo ufw status

To complete the challenge, take a screenshot of your firewall's status.