How to Set up a Firewall for a Remote System in Linux



Linux


In this article, we show how to set up a firewall for a remote system in linux.

So enabling a firewall gives the remote system some added security against attacks.

In this article, we go through the steps of how to enable a firewall for a remote system in linux.

It's a very simple and straightforward process.

In order to enable a firewall in linux, we specify the following 2 lines of code shown below.



sudo ufw allow OpenSSH updates various rules.

sudo ufw enable enables the firewall.

After you run, sudo ufw enable, the terminal will return, 'Command may disrupt existing ssh connections. Proceed with operatoin (y|n)?' Enter in y for yes.

You will then get the mesage that the firewall is active and enabled on system startup.

Below we show this on an actual linux command terminal below.


Setting up a firewall for a remote system in linux


So in this code, the first line we run is, sudo ufw app list.

This just lists the available apps, so to speak.

We then run the function, sudo ufw allow OpenSSH

We then enable the firewall with the statement, sudo ufw enable

So now the firewall is active and enabled.

We can then see the status on our apps with the statement, sudo ufw status

And this puts in place a firewall, which gives added security to our remote system.

And this is how to set up a firewall for a remote system in linux.


Related Resources

How to Randomly Select From or Shuffle a List in Python



HTML Comment Box is loading comments...