RHCSA 9 Practice Questions
The following are non-trivial practice questions/tasks to help you prepare for the RHCSA 9 exam.
No answers are provided; these are intended for self-practice.
1. Swap to a System Non-Destructively
- Add 1 GiB of swap space using a file without removing existing swap.
- Verify current swap usage, then enable an additional swap device persistently.
- Create a swap file on
/var/swapfile1
with 512 MiB and make it permanent. - Increase swap space by adding another swap file under
/swap_extra
. - Add a new 2 GiB disk to the system and configure it as swap without repartitioning.
- Temporarily disable a swap device and re-enable it without rebooting.
- Prioritize a swap partition higher than a swap file.
- Confirm swap entries persist across reboots.
- Add multiple swap files and balance priority levels between them.
- Display system performance metrics showing swap usage.
2. Configure Autofs
- Configure autofs to mount
/home/students
fromnfsserver:/srv/nfs/students
. - Create an indirect map that mounts
/mnt/projectX
from an NFS share. - Configure autofs to time out mounts after 60 seconds of inactivity.
- Use a direct map to mount
/- /etc/auto.direct
. - Automatically mount
/data/reports
from NFS with read-only access. - Troubleshoot why autofs is not automatically mounting
/mnt/shared
. - Configure automount maps stored in LDAP instead of flat files.
- Use wildcards in autofs maps to mount per-user directories.
- Make an autofs entry that mounts based on a variable such as
$USER
. - Verify autofs mounts appear only when accessed.
3. Schedule Tasks Using at and cron
- Schedule a one-time script run tomorrow at 10:00 using
at
. - Write a cron job that runs
/usr/local/bin/cleanup.sh
every Sunday at 01:30. - Schedule a job with
at
to shut down the system at 23:00 today. - Configure a system-wide cron job that rotates logs daily at midnight.
- Prevent user
bob
from using theat
command. - Create a cron job for user
alice
that runs every 15 minutes. - Schedule a one-time job with
at
to append output to a file. - Configure a cron job using
/etc/cron.d
instead ofcrontab
. - Use
cron
to schedule a task only on weekdays. - Troubleshoot why a scheduled cron job isn’t running as expected.
4. Configure Time Service Clients
- Configure
chronyd
to synchronize withtime.example.com
. - Ensure time synchronization persists after reboot.
- Verify current synchronization status using
chronyc
. - Add two public NTP servers to
chrony.conf
. - Configure a local system as an NTP client for
ntp.local
. - Test connectivity to the configured NTP server.
- Force an immediate synchronization with the upstream server.
- Disable
ntpd
and enablechronyd
for time sync. - Configure fallback NTP servers for reliability.
- Verify that the system clock is within 1 second of server time.
5. Manage Default File Permissions
- Set the default umask for all users to
0022
. - Configure a custom umask for user
bob
only. - Confirm new files created by a user respect the system umask.
- Configure
/etc/login.defs
so default umask is inherited by new users. - Demonstrate how to temporarily override umask in a shell session.
- Set directory default ACLs to ensure group members always have
rwX
access. - Configure a umask so new files are not world-readable.
- Troubleshoot why umask changes aren’t applied after login.
- Apply different umask values system-wide vs user-specific.
- Show the difference in file permissions when created with umask 0002 vs 0077.
6. Manage SELinux Port Labels
- List all SELinux port contexts currently defined.
- Add an SELinux rule allowing HTTP on TCP port 8080.
- Change the SELinux label for port 3307 to
mysqld_port_t
. - Remove a custom SELinux port mapping.
- Configure SSH to listen on port 2222 with SELinux enforcement.
- Verify SELinux allows vs blocks services bound to new ports.
- Add a UDP port context for DNS service.
- Test connectivity to confirm SELinux changes took effect.
- Restore the default SELinux port context for a service.
- Troubleshoot why a service fails to bind due to SELinux.
7. Use Boolean Settings to Modify System SELinux Settings
- List all SELinux booleans related to HTTPD.
- Enable a boolean to allow HTTPD to make network connections.
- Make an SELinux boolean change persistent across reboots.
- Disable a boolean to restrict FTP home directory access.
- Temporarily set a boolean for testing only.
- Configure a boolean to allow NFS home directories.
- Set a boolean to allow SSH to forward X11 sessions.
- Verify boolean changes are active.
- Combine multiple boolean changes in a script.
- Troubleshoot why a boolean setting didn’t persist after reboot.
8. List and Identify SELinux File and Process Context
- View SELinux context of all files in
/var/www/html
. - Display SELinux context of the
sshd
process. - Compare SELinux context between
/home/user1
and/home/user2
. - Use
ls -Z
to verify custom SELinux labels on a directory. - List SELinux process contexts with
ps -eZ
. - Confirm whether a file’s context is default or customized.
- Identify mismatched contexts causing a service failure.
- Check SELinux context of a log file in
/var/log
. - Compare SELinux contexts before and after a restore operation.
- Write output of SELinux file contexts to a report file.
9. Configure Superuser Access
- Allow user
devops
to run all commands as root withsudo
. - Restrict user
analyst
to only run/usr/bin/less
withsudo
. - Configure a sudo rule that requires passwordless execution.
- Deny user
guest
from executing any sudo command. - Set up a group
wheel
with full sudo access. - Require
bob
to re-enter his password for each sudo command. - Configure sudo logs to
/var/log/sudo.log
. - Validate sudoers file syntax after changes.
- Create an alias in sudoers for multiple commands.
- Test user privilege escalation to ensure correct configuration.
10. Restore Default File Contexts
- Change the SELinux context of
/var/www/html/index.html
, then restore it. - Use
restorecon
on a single file. - Restore SELinux contexts recursively for
/home/student
. - Apply
restorecon
after modifying a custom policy. - Check default contexts before restoring.
- Restore SELinux contexts using
semanage fcontext
. - Apply restore to files under
/srv/web
after relabeling. - Run restore without affecting unconfined_t contexts.
- Verify restored contexts match defaults.
- Troubleshoot why a context isn’t restored correctly.
11. Configure IPv6 Addresses
- Assign a static IPv6 address to interface
eth0
. - Configure an additional IPv6 address on the same interface.
- Set up an IPv6 default gateway.
- Verify IPv6 connectivity to an external host.
- Make IPv6 configuration persistent across reboots.
- Use
nmcli
to configure IPv6 for DHCP. - Configure IPv6 DNS servers via NetworkManager.
- Test dual-stack (IPv4/IPv6) connectivity.
- Display current IPv6 routes and explain entries.
- Troubleshoot why IPv6 pings to
ipv6.google.com
fail.