The iptables utility controls the network packet filtering code in the Linux kernel. The iptables feature is used to set up, maintain, and inspect the tables of IP packet filter rules in the Linux kernel. Several different tables may be defined. Each table contains a number of built-in chains and may also contain user-defined chains. […]
Archives for May 2017
Basic vi commands (cheat sheet)
vi is one of the most commonly used editor program and included by default with every UNIX and linux system. vi basically operates in 3 modes, namely : vi mode – the mode vi starts in command mode – you can be in command mode from the vi mode by pressing the key colon (“:”) […]
CentOS / RHEL 7 : How to boot into emergency or multi-user mode from GRUB2
Prior to RHEL 7, runlevels were used to identify a set of services that would start or stop when that runlevel was requested. Instead of runlevels, systemd uses the concept of targets to group together sets of services that are started or stopped. A target can also include other targets (for example, the multi-user target […]
CentOS / RHEL 7 : How to add a kernel parameter only to a specific kernel
When we add a parameter to /etc/sysconfig/grub and run grub2-mkconfig -o /boot/grub2/grub.cfg, the parameter will be added to all of the kernel entries. This is the default behaviour of a RHEL 7 system. How can we add kernel parameter to a specific kernel version when there are more than one kernel in the system in […]
What’s the difference between locate and find command in Linux
Two popular commands for locating files on Linux are find and locate. Depending on the size of your file system and the depth of your search, the find command can sometime take a long time to scan all of the data. For example, if you search your entire filesystem for the files named data.txt: # […]
How to use sudo to allow a non-root user run a particular command
With the help of sudo, you can give access to a non-root user to run a root only command. Here is a short howto to provide the non-root user the access to a root only command. The command access that we will give to a user named “john” will be “/sbin/poweroff”. Giving sudo access to […]
CentOS / RHEL 7 : How to rename the volume group for root and swap
The requirement Here’s the current setup – The root and swap volume reside on the volume group named vg_os. # vgs VG #PV #LV #SN Attr VSize VFree vg_os 1 2 0 wz–n- 557.88g 1.88g # lvs vg_os LV VG Attr LSize Pool Origin Data% Meta% Move Log Cpy%Sync Convert lv_root vg_os -wi-ao—- 300.00g lv_swap […]
CentOS / RHEL 6,7 : How to use yum history to roll back a yum update
Note : Rollback of selinux, selinux-policy-*, kernel, glibc (dependencies of glibc such as gcc) packages to older version is not supported. Thus, downgrading a system to minor version (ex: RHEL6.6 to RHEL6.5) is not recommended as this might leave the system in undesired state. Use the yum history option for small update rollbacks. How yum […]
CentOS / RHEL 7 : How to setup yum repository using locally mounted DVD
yum is the primary tool for getting, installing, deleting, querying, and managing Red Hat Enterprise Linux RPM software packages from official Red Hat software repositories, as well as other third-party repositories. The post below describes step by step procedure to use a locally mounted RHEL 7 DVD iso as yum repository. 1. Mount the RHEL […]
CentOS / RHEL 6 : How to setup yum repository using locally mounted DVD
A yum repository (or “repo” for short) is a collection of RPMs in a single location, for example, on a web site or in a directory on a DVD. In RHEL 6.0 Snapshot 12 there are 5 repositories: 1. HighAvailability 2. LoadBalancer 3. ResilientStorage 4. ScalableFileSystem 5. Server The Server repo is the main repo […]