How to save iptables firewall rules permanently on Linux

To save iptables firewall rules permanently on Linux, you can use the iptables-save and iptables-restore commands. Start by saving your current iptables rules by running the following command: sudo iptables-save > /etc/iptables/iptables.rules This command will save the current iptables rules to a file named “iptables.rules” in the “/etc/iptables” directory. To make sure that the iptables … Read more

How to install less on CentOS / RHEL / Fedora

Less is a command-line tool that allows you to view text files in a paginated manner. You can install it on CentOS, RHEL, and Fedora using the package manager. (https://www.fi-di.com/) To install less on CentOS or RHEL: Run the command “sudo yum install less” to install the less package. To install less on Fedora: Run … Read more

How to set/change FQDN on Ubuntu 20.04 Linux

To set or change the Fully Qualified Domain Name (FQDN) on Ubuntu 20.04, you can follow these steps: Open the terminal by pressing “Ctrl + Alt + T” or by searching for “terminal” in the start menu. Run the command “sudo nano /etc/hostname” to open the hostname configuration file in nano text editor. Change the … Read more

Set up automatic unattended updates for Ubuntu 20.04

Ubuntu 20.04 includes a built-in tool called “unattended-upgrades” that allows you to set up automatic updates. Here’s how you can set it up: First, install the package by running the command “sudo apt install unattended-upgrades” Next, configure the package by editing the “/etc/apt/apt.conf.d/50unattended-upgrades” file. In this file, you can set the parameters for the automatic … Read more

How to check TLS/SSL certificate expiration date from command-line

You can check the expiration date of a TLS/SSL certificate from the command line using the “openssl” tool. Here’s an example command that checks the expiration date of a certificate for the domain “example.com”: openssl s_client -connect example.com:443 -servername example.com 2>/dev/null | openssl x509 -noout -dates The “-connect” option specifies the domain and port to … Read more