RHCSA-Objective04-02: Mount and unmount CIFS and NFS network file systems

CIFS – common internet file system
sharing between Windows and Linux
Samba is used to create CIFS shares on linux

NFS – network file share
sharing between Linux systems

Tools required

yum -y install samba-client cifs-utils nfs-utils psmisc

CIFS / SAMBA mount and umount

# to find samba/CIFS shares 
`smbclient -L fileServerIP`

# To temp mount CIFS
mount -t cifs -o username=user //fileserverIP/public. /local/mount/point

# To mount persistant CFS 
## /etc/fstab entry
//Fileserver/sharename /mnt/point cifs username=user,password=1234 0 0
## to mount
mount -a 

# to unmount share
umount /mnt/point   # if you have issues unmount use `fuser /mnt/point`    

NFS mount and unmount

# To find nfs share
showmount -e

# To temp mount NFS
mount -t nfs /mnt/nfsshare

# To mount persistant NFS -
## /etc/fstab entry /mnt/point nfs defaults 0 0 
## to mount
mount -a

# to unmount share
umount /mnt/point   # if you have issues unmount use `fuser /mnt/point`    

RHCSA-Objective04-01: Create, mount, unmount, and use vfat, ext4, and xfs file systems

Create vfat, ext4, and xfs file systems

  1. Make partition with parted / fdisk / gdisk – see Create Partition
  2. Make filesystem with mkfs -t <xfs|ext4|vfat> /dev/sdb3

Mount, unmount, file system

# add the following to /etc/fstab 
/dev/sdb3   /mnt     xfs    defaults  0 0 

To mount filesystem: mount -a
To unmount filesystem: umount /mnt

RHCSA-Objective05-10: Update the kernel package appropriately to ensure a bootable system

update kernel from websource

yum install https://web/source/kernel-*.rpm

update kernel from local rpm

yum install kernel-*.rpm

update kernel from local repo

yum clean all yum update kernel

The grub.cfg will automatically be updated. Reboot after upgrade.

RHCSA-Objective05-11: Modify the system bootloader

paths to know

# grub menu - do not edit directly 
/etc/grub2.cfg   - symlink to /boot/grub2/grub.cfg

# grub2 variables - modify this only not grub2.cfg

grub variables

#variables listed in /etc/default/grub
# boot delay
GRUB_DISTRIBUTOR="$(sed 's, release .*$,,g' /etc/system-release)"
GRUB_TERMINAL="serial console"
GRUB_SERIAL_COMMAND="serial --speed=115200"
# grub cmd line arguments
GRUB_CMDLINE_LINUX="rd.lvm.lv=rhel/swap crashkernel=auto rd.lvm.lv=rhel/root console=ttyS0,115200"
# shows recovery option for kernel 

command to know

# to update changes made to file grub.cfg
grub2-mkconfig -o /boot/grub2/grub.cfg

RHCSA-Objective05-02: Schedule tasks using at and cron



crontab -e – utility for editing cron

cat /etc/crontab – shows example of entry

# Example of job definition:
# .---------------- minute (0 - 59)
# |  .------------- hour (0 - 23)
# |  |  .---------- day of month (1 - 31)
# |  |  |  .------- month (1 - 12) OR jan,feb,mar,apr ...
# |  |  |  |  .---- day of week (0 - 6) (Sunday=0 or 7) OR sun,mon,tue,wed,thu,fri,sat
# |  |  |  |  |
# *  *  *  *  * user-name  command to be executed

# will run every 20 minutes
*/20 * * * * </path/to/script or command>  

crontab -l – to list cron jobs setup with crontab for current user

if you have multiple users each will have there own crontab

systemwide crontab is /etc/crontab or you can place script in /etc/cron.d

cron job directories


  • you can sym link scripts to run to these folders
  • use cron.d if the prefab time does not work, the format is the same as crontab -e for the files in this directory

setup who can run cron

  • /etc/cron.deny – exist by default – list the users that do not have cron permissions
  • /etc/cron.allow – does not exist by default – will only allow root till more users are placed in it


at is not installed by default on minimum installation
yum -y install at
To enable and start at:
systemctl enable atd
systemctl start atd

example usage

 # To exe  in 5 min
 at now +5 minutes
 # To exe at 12:00am
 at 12:00am

 # To view at queue

 # To remove job from queue
 atrm 1

setup who can run at

/etc/at.deny – everyone but the user /etc/at.allow – does not exist by default -root only unless the use name is in the file

RHCSA-Objective05-01: Configure networking and hostname resolution statically or dynamically

hostname resolution statically – from host file

add host name to /etc/hosts   localhost localhost.localdomain localhost4 localhost4.localdomain4
# add an entry for ip    git.local.lab

hostname resolution dynamically – from DNS server

add name server to /etc/resolv.conf

search local.lab

hostname resolution – to set priority on dynamic or static:


# this is default - if hostname exist in file(/etc/hosts) it will not be quarried against DNS server
hosts:      files dns

changing hostname

nmtui – text based gui for setting ip and hostname it changes /etc/hostname
hostnamectl set-hostname greplog.com

Network tools

ip a – obtain nic / ip info
dhclient -r – to release IP
dhclient – to renew IP
ifdown <devNICName> – brings down nic
ifup <devNICName> – brings up nic

Static IP

Ways to set static IP

  • nmtui – can be used to set up static IP it changes –
  • Network manager cli – nmcli
    nmcli con add con-name "eth0" autoconnect yes type ethernet ifname eth0 ip4 gw4
  • manaully edit – /etc/sysconfig/network-scripts/

This is an example of /etc/sysconfig/network-scripts/ifcfg-eth0

   DNS =

Restart network service: systemctl restart network

Dynamic IP

Ways to set DHCP

  • nmtui – can be used to set up dynamic IP it changes –
  • Network manager cli – nmcli
  • manaully edit – /etc/sysconfig/network-scripts/

This is an example of /etc/sysconfig/network-scripts/ifcfg-eth0


RHCSA-Objective05-09: Install and update software packages

Objective: Install and update software packages from Red Hat Network, a remote repository, or from the local file system

Install from remote repository

This is a yum quick reference post I did : Yum Basics .

Install from local file system

Paths to know:

/etc/pki/rpm-gpg/  # location of gpg keys of repos
/etc/yum.repos.d/  # location of yum repos files 
/var/log/yum.log   # location of yum logs

Making a local yum repo

# how to mount iso 
mkdir -p /repos/local

# allows it to be read as block device
mount -o loop cenots.iso /repos/local

vi /etc/yum.repos.d/local-repo.repo
name=CentOS Local ISO repo

RHCSA-Objective04-04: Create and configure set-GID directories for collaboration

Step 1 – Create Folder and Modify Ownership

Create group or use existing group:
groupadd devops

Create shared directory or use existing directory:
mkdir /home/devops

Modify ownership of folder:
chown nobody:devops /home/devops

Step 2 – Change Permissions

chmod 2070 /home/devops


#Set SGID with write permissions on the directory  
chmod g+ws /home/devops

#Remove other and user permissions  
chmod u-rwx,o-rwx /home/devops