Author: Surendra Anne

How to Installing and Configuring Firewalld on Linux

According to the official website of firewalld, “Firewalld provides a dynamically managed firewall with support for network/firewall zones that define the trust level of network connections or interfaces. It has support for IPv4, IPv6 firewall settings, ethernet bridges, and IP sets. There is a separation of runtime and permanent configuration options. It also provides an interface for services or applications to add firewall rules directly.”. So it’s a tool for managing firewall on Fedora/CentOS/RHEL/Debian/Ubuntu and many other famous Linux operating systems along with iptables. You can find more about firewalld at firewalld.org. Let’s see how to use firewalld. Installing firewalld on CentOS/RHEL/Fedora: The firewalld program should install on CentOS/RHEL/Fedora systems by default. Installing firewalld on Ubuntu/Debian By default, firewalld program is not installed on Debian/Ubuntu based systems. But you can easily install it by running the following commands. surendra@linuxnix$ sudo apt-get update surendra@linuxnix$ sudo apt-get install firewalld The architecture of firewalld Program: The firewalld program has two parts. The daemon that runs in the background. The firewall-cmd command to add, modify, remove firewall rules. How firewalld works: The firewalld defines several zones, and each zone has its own interfaces and own rules. The firewall-cmd command can be used to add, modify, remove zones, interfaces from the zones, allow or deny ports for zones. Benefits of firewalld: The most significant advantage of firewalld is that firewalld daemon doesn’t have to...

Read More

4 sleep command examples in Linux/Unix

The sleep is one of the commonly used commands in many shell scripts. The other commands which we frequently use in shell scripts are an echo, read, print commands etc. In this post, we will cover sleep command and TMOUT system variable which are helpful in delaying execution in What is the use of sleep command in Linux? The only purpose of sleep command is to block or delay the execution of a particular script for a defined amount of time. This is a useful mechanism where you have to wait for a specific operation to complete before the start of other activity in your shell scripts. For example, you just start a service in a shell script, and that may take some time to show some results for another command. In these cases, sleep command is used to delay of execution of next command. We can customize how many seconds or minutes or hours or days you can pause the subsequent command execution. Sleep command syntax in Linux sleep NUMBER[SUFFIX]... sleep OPTION Let us take one example to understand this. Observe below simple shell script where we execute it without sleep and with sleep command. The time taken for both the scripts can be calculated using time command. #!/bin/bash echo "Hello World." echo "Goodbye" Execute above script to see how much time it takes. root@linuxnix:~/sh# bash lets_sleep.sh Hello World....

Read More

5 SSH alias examples in Linux

As a Linux user, we use ssh command to log in to remote machines. The more you use ssh command, the more time you are wasting in typing some significant commands. We can use either alias defined in your .bashrc file or functions to minimize the time you spend on CLI. But this is not a better solution. The better solution is to use SSH-alias in ssh config file. A couple of examples where we can better the ssh commands we use. Connecting to ssh to AWS instance is a pain. Just to type below command, every time is complete waste your time as well. ssh -p 3000 -i /home/surendra/mysshkey.pem ec2-user@ec2-54-20-184-202.us-west-2.compute.amazonaws.com to ssh aws1 Connecting to a system when debugging. ssh -vvv the_good_user@red1.taggle.abc.com.au to ssh xyz In this post, we will see how to achieve shorting of your ssh commands without using bash alias or functions. The main advantage of ssh alias is that all your ssh command shortcuts are stored in a single file and easy to maintain. The other advantage is we can use same alias for both SSH and SCP commands alike. Before we jump into actual configurations, we should know difference between /etc/ssh/ssh_config, /etc/ssh/sshd_config, and ~/.ssh/config files. Below is the explanation for these files. Difference between /etc/ssh/ssh_config and ~/.ssh/config System-level SSH configurations are stored in /etc/ssh/ssh_config. Whereas user-level ssh configurations are stored in ~/.ssh/config file. Difference between...

Read More

Over 16,000 readers, Get fresh content from “The Linux juggernaut”

Email Subscribe

ABOUT ME..!

My photo
My name is Surendra Kumar Anne. I hail from Vijayawada which is cultural capital of south Indian state of Andhra Pradesh. I am a Linux evangelist who believes in Hard work, A down to earth person, Likes to share knowledge with others, Loves dogs, Likes photography. At present I work at Bank of America as Sr. Analyst Systems and Administration. You can contact me at surendra (@) linuxnix dot com.