RHCSA Practice Questions¶
Question 1¶
Network Configuration¶
On Node1, you are logged into a Red Hat Enterprise Linux system. Determine the system’s current local network configuration, then configure the default network interface ensXXX to meet the following requirements:
-
Configure a static IPv4 address using:
- An IP address within the same network as the current configuration, with a host ID of
50 - Netmask:
255.255.255.0 - Default gateway within the same network, with a host ID of
1
- An IP address within the same network as the current configuration, with a host ID of
-
Configure the system to use the following DNS settings:
- DNS server:
8.8.8.8 - DNS search domain:
example.local
- DNS server:
-
Set the system hostname to:
rhel-node1.example.com
Ensure the network configuration is persistent across reboots and active immediately
Spoilers
Use nmcli or nmtui to configure the system's network settings.
Question 2:¶
Configure DNF/RPM/YUM Repository Access¶
- On Node1, configure repository access using the repositories located at:
- https://repo.example.com/rhel9_10/BaseOS
- https://repo.example.com/rhel9_10/AppStream
Ensure the repositories are enabled, persist across reboots, and can be used to install packages.
Solutions
For this task, two new repositories must be added. This can be done by adding a
repository file manually or by using dnf config-manager.
Method 1: Using dnf config-manager¶
Enable repositories via DNF config manager:
-
Enable repository access for BaseOS
-
Enable repository access for AppStream
-
Verify that the repositories are available:
-
Both repositories should appear as enabled, however, they cannot be used because gpgcheck is not set.
Check the names given to them bydnf config-managerby running: -
Then for each of the two baseos and appstream repo files, open and enter
gpgcheck=0at the end, or run the commands:
Method 2: Manually Creating Repository Files¶
-
Create a repo file for BaseOS.
- Add the repo configuration.
- Add the repo configuration.
-
Create a repo file for AppStream.
- Add the repo configuration.
- Add the repo configuration.
After adding the repo files, both repositories should be enabled and accessible.
Additional Notes
- Verification using
dnf repolistensures the repos are functional. - Both methods persist across reboots automatically.
-
The
gpgcheck=0disables signature verification, which is acceptable in local/test repositories for exam purposes. -
In the actual RHCSA exam, repo links will point to a fully functional repository source, enabling real package access and installations after configuring as we've done above.
-
So on the exam, we will be able to install packages from the configured repos to test that they work properly.
-
man dnf.conf(search 'repo options')
-
Question 3:¶
Configuring and Securing an Apache HTTP Service¶
On Node1, configure the Apache HTTP Server to meet the following requirements:
- The Apache web service must be installed, enabled, and running.
- The web server must listen on TCP port 85.
- The service must be accessible from both the local system and external hosts.
- When curled or accessed via a web browser, the server must display the following message:
Solutions
-
First, make sure Apache is installed. The package is usually called
httpd.
-
Configure Apache to listen on port 85.
Find the
Listendirective and change it to 85.
Save the file and exit (:wq). -
Create the web content.
Add the required content.
Create or edit the default index.html page.
Save and exit (:wq). -
Allow port 85 through the firewall for external access.
-
Configure SELinux to allow Apache on port 85.
-
Apache is restricted by SELinux to use specific ports. Port 85 must be explicitly allowed.
-
Check if port 85 is already allowed.
-
If port 85 is not listed (expected), add it.
-
This step is mandatory if SELinux is enforcing, which it always is on the exam.
-
Use
manto find good syntax examples to use withman semanage port
-
-
Enable and start Apache web server.
-
Verify that the requirements are met.
Check access from the local system.semanage port -l | grep http # Should list port 85 systemctl status httpd # Should show Apache is enabled and running
Check access from an external system (browser or Node2).
Question 4:¶
User and Group Management¶
On Node1, perform the following user and group management tasks:
- Create a group named admins with a fixed GID of 3500.
- Create a group named users
-
Create the following user accounts with the specified requirements:
-
harry- Primary group:
admins - Secondary group:
users - User ID
3455
- Primary group:
-
natasha- Supplementary groups:
adminsandusers - User ID of
3456
- Supplementary groups:
-
sarah- Must not be a member of the
adminsgroup - Must not have access to an interactive shell
- Must not be a member of the
-
bruce- Member of
adminsgroup - Home directory must be created explicitly
- Member of
-
-
Set the password for all created users to:
Question 5:¶
Shared Group Directories and Permissions¶
On Node1, as root, create shared collaboration directories for group-based access with the following requirements:
-
Create the following directories:
/groups/admins/groups/users
-
Configure
/groups/adminsas follows:- The group owner of the directory must be
admins - Members of the
adminsgroup must have full access (read, write, and execute) - No access must be granted to users outside the
adminsgroup - The directory owner must remain
root, with full access - All newly created files and directories within
/groups/adminsmust automatically inherit theadminsgroup ownership
- The group owner of the directory must be
-
Configure
/groups/usersas follows:- The group owner must be
users - Owner and members of the
usersgroup must have read, write, and execute access - Other users must have no access
- New files created in this directory can only be deleted by the file owner or root.
- The group owner must be
Spoilers
- Use the set user ID (setuid, 4), set group ID (setgid, 2), and restricted deletion/sticky (1) permission bits to meet the requirements.
-
The setgid bit (2) will have every file inherit the group ownership when set on a directory.
-
The sticky bit can be used to prevent anyone from deleting files in the directory unless they are the owner (or root).
Question 6:¶
Configuring NFS + Autofs¶
On Node1, configure autofs to automatically mount remote user home directories with the following requirements:
-
Install and enable the autofs service.
-
Configure automounting so that user home directories are accessed under /homes/remote.
-
The remote NFS export is available from server.example.com at /exports/home. This directory contains users john and mary home directories as /exports/home /john & /exports/home/mary.
-
Home directories must be mounted on demand and unmounted automatically after 60s of inactivity.
-
The autofs configuration must persist across reboots.
-
Do not manually mount the filesystem.
BONUS: Configuring Node2 as an NFS Server so that Node1 is its NFS Client
-
Step 1: Install required NFS packages
-
Step 2: Create the export directory
- Add the directories mary and john in /exports/home with any relevant contents.
-
Step 3: Configure NFS exports
- Edit /etc/exports:
Add the following line:
This allows read/write access and ensures predictable behavior for lab environments.
Note for simplicity, just
is sufficient and should work normally.
The
*in/exports/home *(rw)allows access from any host; to restrict access explicitly to Node1, replace*with Node1's hostname or IP address, for example: OR
- Edit /etc/exports:
Add the following line:
This allows read/write access and ensures predictable behavior for lab environments.
Note for simplicity, just
is sufficient and should work normally.
The
-
Step 4: Enable and start the NFS services
- Confirm status:
-
Step 5: Configure the firewall to allow NFS access
OR scripted:firewall-cmd --permanent --add-service=nfs firewall-cmd --permanent --add-service=mountd firewall-cmd --permanent --add-service=rpc-bind- Next (very important)
-
Step 7: Verification (recommended)
-
From Node2 (the NFS server):
-
From Node1 (the NFS client):
Expected output should include:
-
-
Result: Node2 is now successfully configured as an NFS server exporting
/exports/home, along with all its sub-directories, ready to be consumed by autofs on Node1 or any other VM for the RHCSA practice scenario.
Question 7:¶
Cron Job for User¶
On Node1, as the user bruce, perform the following tasks:
-
Create a cron job that executes daily at 12:45 AM.
-
The job should print (echo) the message:
-
The job should continue to exist and run as expected across reboots.
-
Hint: Use the standard crontab for the user rather than placing scripts in
/etc/cron.dunless explicitly instructed.
Solution
Solution for Question 7¶
Step 1: Switch to the user bruce
Step 2: Edit the user's crontab
ORStep 3: Add the cron job entry
Hint: You can always use cat /etc/crontab as a cheat sheet to get information
on what each entry represents.
Add the following line:
OR Explanation (exam clarity):45: minute0: hour (12:45 AM / 00:45)* * *: every day
To get the correct full path, run the command which echo, which log, etc.
Step 4: Save and exit the editor (:wq) OR ZZ
The cron job is now registered in bruce’s user crontab.
Step 5: Verify the cron job as user bruce
Expected output:
Step 6: Ensure persistence across reboots
No extra action is required.
Why:
User crontabs are managed by the crond service and persist automatically across
system reboots, provided the service is enabled (default on RHEL).
(Optional verification as root)
Extra Practice/Verification:¶
You can set(edit) the cron job to run at a sooner time, say in the next minute or two.
After the set time has passed, verify that it runs as it should by running the command:
Question 8:¶
Ownership, Permissions, and ACLs¶
On Node1, copy the file /etc/fstab to /var/tmp and configure its ownership and
permissions to meet the following requirements:
- The copied file must be owned by
root. - The file must belong to the
adminsgroup. - The file must not be executable by any user.
- The user owner and group owner should have read and write access.
- User
harrymust have read and write access to the file. - User
brucecan read but not write to the file. - User
natashamust have no read or write access to the file. - All other users, including users created in the future, must have read-only access to the file.
Note
ACLs are no longer listed as an exam objective for RHEL 10.
However, they remain a simple yet powerful feature that every Linux system
administrator should understand. They take only a few minutes to learn and are
extremely useful for managing permissions in real-world environments, so it's
well worth taking the time to become familiar with them.
Solution
Step 1: Copy the file to the target location
Step 2: Set ownership and group ownership
Step 3: Remove all executable permissions
Step 4: Set base permissions for owner, group, and others
User owner (root): read and write Group owner (admins): read and write Others: read-only
At this point:
- Root → 6 → read/write
- Group (admins) → 6 → read/write
- Others → 4 → read-only
Note: This step grants the user, group and owner permissions in one go while also restricitng the execution permission for all, so you could skip Step 3.
Step 5: Configure ACLs for specific user requirements
Grant harry read and write access
Grant bruce read-only access
Explicitly deny natasha read and write access
Step 6: Verify permissions
Expected output:
Verify ACL configurationExpected key entries:
Question 9:¶
Configure NTP Client Synchronization¶
On Node1, configure the system to synchronize its system time with the NTP server time.google.com and meet the following requirements:
- Configure Node1 to use time.google.com as its only time source.
- Ensure time synchronization is enabled and active.
- The configuration must persist across reboots.
- Verify that the system clock is synchronized with the configured NTP server.
Question 10:¶
Locate, Copy, and Secure Files¶
On Node1, perform the following tasks:
-
Locate all regular files under the
/etcdirectory that are larger than 900 KB but smaller than 5 MB. -
Copy all matching files to the directory
/find/largefiles. - Preserve the original file ownership, permissions, and timestamps during the copy operation.
Question 11:¶
Boot Configuration and Troubleshooting¶
On Node1, ensure that system boot messages are displayed during startup to assist with troubleshooting.
- Remove any kernel parameters that suppress boot messages so that verbose output is enabled.
- The configuration must persist across reboots.
Question 12:¶
Archive and Compress System Files¶
On Node1, create a compressed archive of the directory /var/tmp with the
following requirements:
- The archive must include all files and subdirectories under
/var/tmp - The archive must be compressed using
gzip - Save the resulting archive as
/root/backup.tar.gz - The operation should preserve file permissions and directory structure
Question 13:¶
Configure Default File and Directory Permissions¶
On Node1, configure the system so that for the user bruce, the following
default permissions apply:
-
Newly created regular files must have permissions set to
-r-------by default. -
Newly created directories must have permissions set to
dr-x------by default. -
The configuration must apply automatically to all future files and directories created by
bruce.
Hint: think of umask.
Question 14:¶
Enforce Password Policies for New Users¶
On Node1, configure the system so that all newly created users meet the following password requirements:
- Passwords must expire after 30 days.
- Passwords must be at least 9 characters long.
Question 15:¶
Configure Sudo Access¶
On Node1, perform the following tasks:
- Create a new user
janeand ensure thatjanecan execute commands withsudo. - Configure the system so that all members of the group
adminscan execute commands withsudowithout being prompted for a password.
Question 16:¶
Create a User Script That Executes at Login¶
On Node1, perform the following tasks as the user jane:
-
Create a shell script search_bash.sh that searches for the string "bash" in
/etc/passwdand copies the matching lines, in the same order, to the filebash-users.txtin jane's home directory. -
Configure the script to automatically run whenever
janelogs in.
Requirement:
- Grant privileged access of
/etc/passwdto user jane if necessary. - The script must be user-specific; do not modify system-wide login scripts.
Question 17:¶
Reset Root Password¶
On Node2, assume the root password is unknown. Reset the root password to:
Question 18:¶
Logical Volume Configuration¶
On Node2, create a logical volume named lvdata and configure it according to the following requirements:
-
The logical volume must be created from a volume group named
vgstoreand must use exactly 50 physical extents. -
The volume group
vgstoremust be created from an lvm partition on vdb (orsdb,nvme0n2, or any available secondary disk as appropriate) and must use a physical extent size of 8 MiB. -
Format the logical volume with the ext4 filesystem and mount it persistently on
/mnt/data.
Info
Don't delete the logical volume (LV) when done with the task, as this LV is used later on in question 20.
Question 19:¶
Create Swap Partition¶
On Node2, perform the following tasks:
-
Create a 512 MB swap partition on the same disk used previously (
vdb,sdb, ornvme0n2, as appropriate). -
Configure the system to use this partition as swap space.
-
Ensure the swap is enabled immediately and mounted persistently so that it is active after a reboot.
Question 20:¶
Resize Logical Volume¶
On Node2, resize the previously created logical volume lvdata in the vgstore volume group to use a total of 85 physical extents.
-
Add a third partition of appropriate size to the secondary disk and use if for this purpose.
-
Ensure that the filesystem on the logical volume is adjusted appropriately so that the new space is available for use.
Requirement:
Ensure the logical volume remains mounted at /mnt/data and is usable after resizing.
Question 21:¶
Enable Recommended Tuning Profile¶
On Node2, perform the following task:
Enable the recommended tuning profile to optimize the system performance according to Red Hat best practices.
Verify that the tuning profile has been successfully applied and is active.
Question 22:¶
Containers/Flatpak Configuration¶
RHCSA 9 ONLY - Run a Rootless Container as a Systemd Service¶
On Node2, as the non-root user russ (password: russpass), create and manage
a container with the following requirements:
Pull the container image registry.redhat.io/ubi9/ubi from the Red Hat registry
(create a developers.redhat.com account using a browser, if required, and
authenticate to the registry using valid credentials).
Run a container named ubicon based on this image.
Configure the container to:
-
Map host port
8089to container port8089 -
Persist data by binding two host directories, including
/opt/outon the host to/opt/ininside the container, and a second host directory/opt/sendto/opt/receivein the container. -
Finally, configure the container to be managed as a user-level systemd service with the name
container-ubicon, ensuring it is enabled and automatically starts on system reboot without requiring root privileges.
RHCSA 10 ONLY - Configure Flatpak Repositories¶
On Node2, perform the following tasks:
-
Install the flatpak package manager using the appropriate system package management tools.
-
Add the official flathub remote repository to the system using the link:
- https://flathub.org/repo/flathub.flatpakrepo
-
Add the official rhel flatpak remote repository if not present. Use the link:
- https://flatpaks.redhat.io/rhel.flatpakrepo
-
Verify that all configured flatpak remotes are properly added to the system.
Question 23:¶
Configure SELinux Booleans/System Journals¶
On Node2, perform the following tasks:
-
Enable the SELinux boolean
httpd_can_network_connectso that the Apache web server is allowed to initiate outbound network connections. Ensure the change persists across reboots. -
Configure the system to preserve system journals.
Spoilers
Question 24:¶
Secure File Transfer / Key-Based Authentication¶
On Node2, perform the following tasks as root:
-
Configure key-based, passwordless SSH authentication from Node2 to Node1 for secure access to the user natasha on Node1.
-
Once authentication is established, securely copy the file
/etc/fstabfrom Node2 tonatasha's home directory on Node1. -
Ensure that the copied file is owned by natasha and retains appropriate permissions for her to read and write.
-
Requirement: Use a secure, encrypted method for the file transfer.
Question 25:¶
At Job & Systemd Timer¶
BOTH RHCSA 9 & 10 - Create a one-time at job¶
On Node2, as the user russ, schedule a one-time job to run tonight at 21:30
that appends the line:
/home/russ/practice.log.
RHCSA 10 ONLY - Systemd Service & Timer¶
On Node2, configure a recurring task by completing the following:
-
Create an executable script named log.sh in /usr/local/bin/ that writes the message RHCSA Practice Exam 1 Complete! to the system journal using the logger command.
-
Create a systemd oneshot service named log.service that runs the script.
-
Create a systemd timer named log.timer that triggers the service every 1 minute and ensures missed runs are executed after reboot (persistent behavior).
-
Enable and start the timer so it begins working immediately and persists across reboots.
-
Verify that the timer is active and that the message appears repeatedly in the system journal as the timer executes.
-
Once you have confirmed the timer is working correctly, modify it so the service runs hourly instead.
Good to Know¶
-
For repo setup,
gpgcheck=0disables signature verification, which is acceptable in local/test repositories for exam purposes. -
In the actual RHCSA exam, repo links will point to a fully functional repository source, enabling real package access and installations after configuring as we've done above.
-
So on the exam, we will be able to install packages from the configured repos to test that they work properly.
-
man dnf.conf(search 'repo options')
-
Things to Work On¶
- Setting up SWAP partitions
- Physical Extents in LVM
- (question 6) NFS and autofs
- (question 8) Ownership, Permissions, and ACLs
- (question 9) Configure NTP Client Synchronization
- (question 22) Flatpak repos and config
- (question 23) SELinux booleans and system journals
- Convert subnet mask to CIDR notation (beyond
255.255.255.0=/24) /etc/sysconfig/network-scripts/- Flatpak -- Does RHEL10 have a flatpak repo?
- Can we install packages on our exam boxes that were not specified?
- e.g.,
dnf-plugins-core - Likely not, but we should get clarification on this
- e.g.,
- SELinux (ports, etc.)
semanagesemanage port
- Firewalld (
firewall-cmd) - Special permission bits
- setuid (4), setgid (2), sticky bit (1)
-
PAM password quality configuration:
vim /etc/security/pwquality.conf
-
Basic archive creation and extraction (
-zto use bzip2)-
Creation:
-c: create-z: compress with gzip-v: verbose-
-f: filename of the archive to create- Extraction
-
-x: extract -z: decompress with gzip-v: verbose-f: filename of the archive to extract-C: change to directory before extracting- This will extract the contents of the archive into
/root/ - Without this option, the contents will be extracted into the
current working directory (
$PWD).
- This will extract the contents of the archive into
-
partprobe