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 (“:”) […]
Change default kernel (boot with old kernel) in CentOS/RHEL/OEL 5 and 6
The following post shows the procedure to boot CentOS/RHEL/OEL 5 and 6 systems into different kernel installed. CentOS/RHEL/OEL 5 and 6 operating system uses GRUB as the default boot loader. When you install a kernel using either rpm, up2date or yum application, the kernel package creates an entry in the boot loader configuration file for […]
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: # […]
Change default kernel (boot with old kernel) – CentOS/RHEL/OEL 7
Question: How to modify the GRUB2 default entry to boot a different Kernel version? 1. Check the current running Kernel Version # uname -a Linux geeklab 3.8.13-94.el7uek.x86_64 #2 SMP Wed Feb 11 14:18:22 PST 2015 x86_64 x86_64 x86_64 GNU/Linux 2. List the Kernel Entries as per GRUB2 file: # awk -F\’ ‘$1==”menuentry ” {print $2}’ […]
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 […]