Skip to content

RHCSA Exam Practice

RHCSA Practice exams

  1. How to create a local YUM repository using a RHEL 9 ISO image, assuming the image is mounted on either /mnt or /run in a Linux VM?

    To set up a local YUM repository on RHEL 9, follow these steps:
    
    Mount the RHEL 9 ISO to a directory, typically /mnt or /run/media.
    
    Create a repo file under `**/etc/yum.repos.d/**`, e.g., `**rhel9-local.repo**`.
    
    In the file, add:
    
    1. [rhel9-local]
    2. name=RHEL 9 Local Repository
    3. baseurl=file:///mnt
    4. enabled=1
    5. gpgcheck=0
    
    Adjust `**baseurl**` according to the mount point.
    
    Update the repository list using `**yum update**`.
    
    This method turns the mounted ISO into a local repository, enabling package installation directly from the ISO image.
    
  2. How to configure a network interface in Red Hat Enterprise Linux 9 to use a static IP address setup with these parameters: IPv4 address 192.168.1.211 with a 24-bit subnet mask, a gateway of 192.168.1.1, and a DNS server address of 8.8.8.8?

In RHEL 9, configure a static IP by editing the network interface config file at `**/etc/sysconfig/network-scripts/ifcfg-[InterfaceName]**`. Replace `**[InterfaceName]**` with your interface name (e.g., `**eth0**`). Add these lines:

1. BOOTPROTO=static
2. ONBOOT=yes
3. IPADDR=192.168.1.211
4. PREFIX=24
5. GATEWAY=192.168.1.1
6. DNS1=8.8.8.8

Save the file and restart the network service: `**sudo systemctl restart NetworkManager**`.

This sets a static IP (`**IPADDR**`), subnet mask (`**PREFIX**`=24), gateway (`**GATEWAY**`), and DNS (`**DNS1**`). `**BOOTPROTO=static**` enables static IP setup, and `**ONBOOT=yes**` activates it on boot.
  1. Add secondary IP via nmcli NetworkManager.
    nmcli conn show
    
nmcli conn modify eth0 +ipv4.address 192.168.1.31/24

Restart Network Manager or down/up eth0

nmcli conn down eth0 && nmcli conn up eth0
  • Setup NTP

    dnf install chrony
    
  • enable and start chronyd daemon

systemctl enable --now chronyd
  • Check sources
chronyc sources
cat /etc/chrony.conf | grep -v '#'
pool 2.rhel.pool.ntp.org iburst
  • Create Thin provisioned volume named 1thinpool

    lvcreate --type thin-pool --size 50G --name 1thinpool [VolumeGroupName]
    
  • Setup process history from scratch starting with

  • fdisk /dev/sda - create sda1
  • pvcreate /dev/sda1 - create physical volume
  • vgcreate thimvg /dev/sda1
  • lvcreate --type thin-pool --size 5000M --name 1thinpool thimvg
  • mkdir /mnt/thinpool
  • mkfs.xfs /dev/thimvg/1thinpool
  • mount /dev/thimvg/1thinpool /mnt/thinpool/
  • df -h /mnt/thinpool/

  • Copy files larger than 5M from /etc/ to /tmp/files3m/

    find /etc/ -type f -size +5M -exec cp -v {} /tmp/files3m/ \;
    

Configure detailed messages on boot

  • Edit grub configuration at /etc/default/grub , edit the GRUB_CMDLINE_LINUX add debug and remove quite and rhgb
  • Then configure it with grub2-mkconfig -o /boot/grub2/grub.cfg

Set password strength of 8 characters and 90 days expiration

change -M 90 username
- Edit /etc/security/pwquality.conf add minlen=8