Site icon CentLinux

10 Practical Tasks for RHCSA Exam with Solutions

Share on Social Media

Discover 10 practical tasks for the RHCSA exam with step-by-step solutions. Boost your Linux skills and prepare effectively with these real-world scenarios and answers. #centlinux #linux #rhcsa

Introduction

Preparing for the Red Hat Certified System Administrator (RHCSA) exam requires hands-on experience with a wide range of Linux system administration tasks. This performance-based exam tests your ability to perform real-world tasks on a live system, making practical knowledge crucial for success. This article covers ten practical tasks you are likely to encounter in the RHCSA exam, along with solutions to help you practice and master these skills.

10 Practical Tasks for RHCSA Exam

Task 1: Managing Users and Groups

Problem: You need to create a new user, add them to a group, and set a password policy.

Solution:

Create a New User:

   useradd john

Set a Password for the User:

   passwd john

Create a New Group and Add the User to the Group:

   groupadd developers
   usermod -aG developers john

To force the user to change their password every 30 days:

   chage -M 30 john

Task 2: Configuring File Permissions

Problem: You need to set specific permissions for a file so only the owner can read and write, the group can read, and others have no access.

Solution:

Create a File:

   touch /home/john/myfile.txt

Change Ownership of the File:

   chown john:developers /home/john/myfile.txt

Set File Permissions:

   chmod 640 /home/john/myfile.txt

Here, 640 means:

Task 3: Working with SELinux

Problem: Verify the current SELinux status, switch it to permissive mode, and restore a file’s security context.

Solution:

Check SELinux Status:

   sestatus

Switch to Permissive Mode Temporarily:

   setenforce 0

Make Permissive Mode Permanent by editing the /etc/selinux/config file and set SELINUX=permissive.

Restore Security Context of a File:

   restorecon -v /home/john/myfile.txt

Task 4: Managing Network Configuration

Problem: Configure a static IP address for a network interface.

Solution:

Edit the Network Interface Configuration File:

   vi /etc/sysconfig/network-scripts/ifcfg-eth0

Add/Modify the Following Lines:

   BOOTPROTO=static
   IPADDR=192.168.1.10
   NETMASK=255.255.255.0
   GATEWAY=192.168.1.1
   DNS1=8.8.8.8
   ONBOOT=yes

Restart the Network Service:

   systemctl restart network

Task 5: Configuring Firewalls with FirewallD

Problem: Open port 80 for HTTP traffic and reload the firewall settings.

Solution:

Check Firewall Status:

   systemctl status firewalld

Open Port 80:

   firewall-cmd --permanent --add-port=80/tcp

Reload the Firewall Configuration:

   firewall-cmd --reload

Verify Port 80 is Open:

   firewall-cmd --list-ports

Read Also: 10 Practical Tasks for RHCE Exam

Task 6: Managing Storage and Partitions

Problem: Create a new partition, format it with the ext4 filesystem, and mount it.

Solution:

Use fdisk to Create a New Partition:

   fdisk /dev/sda

Follow prompts to create a new partition.

Format the Partition with ext4:

   mkfs.ext4 /dev/sda3

Create a Mount Point and Mount the Partition:

   mkdir /mnt/newpart
   mount /dev/sda3 /mnt/newpart

Make the Mount Permanent by Adding to /etc/fstab:

   echo '/dev/sda3 /mnt/newpart ext4 defaults 0 0' >> /etc/fstab

Task 7: Automating Tasks with cron

Problem: Schedule a daily backup script to run at 2 AM using cron.

Solution:

Edit the crontab for the Root User:

   crontab -e

Add the Following Line to Schedule the Script:

   0 2 * * * /home/john/backup.sh

This line means the script will run at 2:00 AM every day.

Verify the Scheduled Job:

   crontab -l

Task 8: Configuring and Managing Services

Problem: Start, stop, and enable the Apache HTTP server to start at boot.

Solution:

Install the Apache HTTP Server:

   yum install httpd -y

Start the Apache Service:

   systemctl start httpd

Stop the Apache Service:

   systemctl stop httpd

Enable Apache to Start at Boot:

   systemctl enable httpd

Check the Status of the Apache Service:

   systemctl status httpd

Task 9: Managing Software Packages

Problem: Install, update, and remove software packages using yum.

Solution:

Install a Package (e.g., wget):

   yum install wget -y

Update All Packages:

   yum update -y

Remove a Package (e.g., wget):

   yum remove wget -y

List Installed Packages:

   yum list installed

Task 10: Basic Troubleshooting and Maintenance

Problem: Troubleshoot a network connectivity issue and analyze system logs.

Solution:

Check Network Configuration:

   ip addr show

Test Connectivity:

   ping 8.8.8.8

Analyze System Logs for Network Issues:

   tail -n 50 /var/log/messages

Check Specific Service Logs (e.g., httpd):

   journalctl -u httpd

Monitor System Performance:

   top

This command provides a real-time view of system processes and resource usage.

Recommended Training: Linux Administration: The Complete Linux Bootcamp in 2025 from Andrei Dumitrescu, Crystal Mind Academy

Conclusion

Mastering these practical tasks is essential for passing the RHCSA exam and becoming a proficient Linux administrator. Practicing these scenarios in a virtual lab environment will help you gain the confidence needed to handle real-world challenges effectively. Remember, consistent practice and a clear understanding of core Linux concepts are key to success.

Your Linux servers deserve expert care! I provide reliable management and optimization services tailored to your needs. Discover how I can help on Fiverr!

FAQs

Exit mobile version