×

How-to articles, tricks, and solutions about Linux


Fix Inactive UFW Status on Ubuntu 22.04 (Jammy Jellyfish)

This article covers how you can easily activate the Firewall status on Ubuntu system and protect it from almost all the potential threats and attacks. In fact, The Uncomplicated Firewall (ufw) is a frontend for iptables and is particularly well-suited for host-based firewalls. ufw provides a framework for managing netfilter, as well as a command-line interface for manipulating the firewall.


How to enable UFW status on Ubuntu ?

To enable UFW, run the below command: 

$ sudo ufw enable


How to Open SSH TCP port 22 connections ?

1. We can easily open SSH TCP port 22 using UFW as follows:

$ sudo ufw allow ssh

2. If you are running ssh on TCP port 2222 or TCP port 2323, run:

$ sudo ufw allow 2222/tcp
$ sudo ufw allow 2323/tcp

Run Background Process in Ubuntu 22.04 (Jammy Jellyfish) Linux system

This article covers the ways of sending a process to the background in Ubuntu Linux system. In fact, a background process is a process/command that is started from a terminal and runs in the background, without interaction from the user.


Commands to find out what processes are running in the background ?

  • ps command - You can use the ps command to list all background process in Linux. Other Linux commands to obtain what processes are running in the background on Linux.
  • top command – Display your Linux server's resource usage and see the processes that are eating up most system resources such as memory, CPU, disk and more.
  • htop command – Just like a top command but with an improved user interface.

UFW Allow Port on Ubuntu 22.04 (Jammy Jellyfish)

This article covers the procedure of allowing a UFW port on Ubuntu. In fact, UncomplicatedFirewall (UFW) is a command-line, frontend iptables manager, similar to Firewalld and ConfigServer Security & Firewall (CSF). 


How to Close a Port using UFW on Ubuntu ?

After you uninstall software you should close any ports you no longer need open on your system. You can accomplish this using the service name or port number.

1. To close a port in UFW using the service name:

$ sudo ufw deny pop3

2. To close a port in UFW using the port number:

$ sudo ufw deny 995


How to Check Open Ports using UFW on Ubuntu ?

1. To check whether UFW is running:

$ sudo ufw status 

2. To check whether UFW is running with additional information such as logging and profile status:

$ sudo ufw status verbose

3. To find the rule number for UFW rules:

$ sudo ufw status numbered

4. Then you can remove the rule:

$ sudo ufw delete 1

UFW Remove Rule in Ubuntu 22.04 (Jammy Jellyfish) Linux system

This article covers how you can easily delete any UFW rule from Ubuntu system firewall. In fact, In Ubuntu Firewall, we can delete firewall rules by the rule number or the original rule by using ufw delete command.


How to find the corresponding firewall rule number using ufw on Ubuntu ?

Easiest and best method is to remove firewall rules by the rule number. We can find the corresponding rule number using ufw status numbered command:

$ ufw status numbered

Then Delete the rule using ufw delete command. or example, if you want to delete rule number '2', execute:

$ ufw delete 2


How to Delete All Firewall Rules on Ubuntu ?

The ufw reset command will remove all firewall rules and also it will disable the UFW on Ubuntu.

$ ufw reset

Python Compare Strings - How it works ?

This article covers how to compare strings in Python. In fact, Python comparison operators can be used to compare strings in Python. These operators are: equal to (==), not equal to (!=), greater than (>), less than (<), less than or equal to (<=), and greater than or equal to (>=). 

Which Flavour of Ubuntu Should You Choose ?

This article covers the Best 8 Flavours of Ubuntu to use. In fact, Ubuntu flavours offer a unique way to experience Ubuntu, each with their own choice of default applications and settings.