How to secure Ubuntu using Uncomplicated Firewall

You just installed Ubuntu Desktop 18.04 and can assume that your desktop is quite safe. That assumption is usually correct. However, we all know that any computer connected to the network is not safe.

You just installed Ubuntu Desktop 18.04 and can assume that your desktop is quite safe. That assumption is usually correct. However, we all know that any computer connected to the network is not safe. Users must always do everything possible to protect the computer from the risk of being attacked. To be honest, the Ubuntu desktop is much safer than the Windows desktop. But that doesn't mean you shouldn't take additional steps to secure it.

In fact, users can take one more step when deploying the desktop, to make it more secure. That is activating the firewall. The Ubuntu Desktop firewall (also known as Uncomplicated Firewall - or ufw) is not enabled by default.

How to secure Ubuntu using Uncomplicated Firewall Picture 1How to secure Ubuntu using Uncomplicated Firewall Picture 1

Using the sudo ufw command indicates that the firewall on the Ubuntu Desktop 18.04 installation will not work. Fortunately, activating it is quite simple.

Activate the Ubuntu firewall

To activate UFW firewall, enter the following command:

 sudo ufw enable 

At this point, the firewall is active and the system will also restart. However, there is a small problem. The firewall is currently active and blocks all incoming traffic.

How to secure Ubuntu using Uncomplicated Firewall Picture 2How to secure Ubuntu using Uncomplicated Firewall Picture 2

Enable SSH connection

For example, when remote desktop control is needed, you will probably use SSH to have this access, but with basic firewall setup, SSH connections are denied. In other words, it is necessary to allow safe shell connection to the desktop. To do this, you can use the ufw command as follows:

 sudo ufw allow ssh 

Now, new rules have been added.

How to secure Ubuntu using Uncomplicated Firewall Picture 3How to secure Ubuntu using Uncomplicated Firewall Picture 3

At this point, it is possible to connect the safe shell to the desktop. Of course, to make SSH connections more secure, always use the SSH key authentication option.

That's all it takes. Ubuntu Desktop is now much safer. Of course, this is not all that can be done to secure Ubuntu Desktop. There are a lot of other steps that can be taken to better secure Ubuntu Desktop, such as using a safer web browser, encrypting data, restricting access to su commands, using DNS-over-TLS , etc.). But for those who are looking for ways to fix security issues quickly, enabling a firewall on Ubuntu Desktop is an extremely effective option.

Good luck!

See more:

  1. How to run and install Pantheon Desktop on Ubuntu
  2. Instructions on how to install Ubuntu on VirtualBox virtual machine
  3. How to install Ubuntu and still keep Windows
4 ★ | 1 Vote