Clear, practical technology insights BSOD Code Lookup · Windows Error Code Lookup · Wi-Fi Troubleshooting · PC Troubleshooting Checklist

How to Secure Ubuntu Using Uncomplicated Firewall

Learn how to secure Ubuntu Using Uncomplicated Firewall with clear steps, practical examples, and troubleshooting tips for safer, more reliable results.

Table of Contents

How to Secure Ubuntu Using Uncomplicated Firewall is easier to understand when the core ideas are paired with practical examples. The sections below explain the topic clearly, highlight useful steps, and point out details that can prevent common errors.

You just installed Ubuntu Desktop 18.04 and can assume that your desktop is quite safe. That assumption is typically 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 example image 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 example image 2

Enable SSH connection

As an 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 example image 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.

  • How to run and install Pantheon Desktop on Ubuntu
  • Instructions on how to install Ubuntu on VirtualBox virtual machine
  • How to install Ubuntu and still keep Windows

FAQ

What should you know about activate the Ubuntu firewall?

To activate UFW firewall, enter the following command:

What should you know about enable SSH connection?

As an 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.

What is How to Secure Ubuntu Using Uncomplicated Firewall?

You just installed Ubuntu Desktop 18.04 and can assume that your desktop is quite safe.

Discussion

Reader Comments 0

Sign in with email or Google to join the discussion.