The RHCSA is a hands-on exam: you get two servers and a list of tasks, and the result is checked after a reboot. You get ready by doing the tasks until they are routine. This guide says where to do each part, how to build a practice VM for the parts a browser lab can't reach, and walks through the boot tasks on that VM.
What runs in the browser
BrokenCluster's RHCSA labs open a Rocky Linux 9 machine (binary-compatible with RHEL 9). These run there for real:
- Software:
dnfwith signed repositories on an internal mirror, installing and removing packages. - Services:
systemctl, unit files,Restart=, the default target, the journal. - Firewall: the real
firewallddaemon andfirewall-cmd, runtime and permanent. - Users: groups, password ageing,
sudorules, shared directories with setgid and the sticky bit. - Scheduling, time and tuning:
cronandat,chronyd,tuned. - SSH and the basics: SSH keys and
sshd_config, archives,find, scripts.
Start with Point dnf at the offline repositories, Open one port, close an unused service and Turn a script into a service.
What needs a VM, and why
A lab machine is a container: it shares the server's kernel and has no disks or bootloader of its own. So these objectives need a VM:
- SELinux: labels, booleans, ports. The kernel decides, and the lab servers don't run SELinux. See the SELinux guide.
- Partitions, LVM, swap, fstab: these need block devices. See the storage guide.
- Boot targets for real, GRUB, the root password reset: these need a real boot. They are below.
- Containers with podman, NFS and autofs: these need the kernel's namespaces and mounts. See the containers and NFS guide.
Build the practice VM (about 20 minutes)
- Download the Rocky Linux 9 minimal ISO (rockylinux.org), or AlmaLinux 9.
- In VirtualBox, VMware Workstation or KVM (virt-manager), create a VM with 2 CPUs, 2 GB of RAM and a 20 GB disk. Then add two more empty disks of 5 GB each: they become
/dev/sdband/dev/sdc(orvdb,vdcon KVM) for the storage tasks. - Install with the "Minimal Install" software choice, set a root password, and create a user who is an administrator.
- After the first boot, take a snapshot called
clean. Rolling back to it in seconds is what makes it safe to break the VM on purpose.
A second VM made the same way (or a clone) gives you the exam's two-server setup for NFS and SSH tasks.
Reset the root password
On the VM (it can't be done in a container), reboot and interrupt GRUB:
- At the GRUB menu, press
eon the default entry. - At the end of the line that starts with
linux, addrd.break, then pressCtrl-xto boot. - At the
switch_root:/#prompt:
mount -o remount,rw /sysroot
chroot /sysroot
passwd root
touch /.autorelabel
exit
exit
The machine relabels its files (a minute or two on a small VM) and reboots on its own. Log in with the new password.
- Forgetting
remount,rw:passwdfails with "Authentication token manipulation error", because/sysrootis read-only. - Forgetting
/.autorelabel: the new/etc/shadowhas no SELinux label, and every login fails after the reboot. Reset again, and this time relabel.
Boot targets for real
systemctl get-default
sudo systemctl set-default multi-user.target # the next boot
sudo systemctl isolate rescue.target # now: drops to a root maintenance shell
To boot into a different target once, press e in GRUB and add systemd.unit=rescue.target (or emergency.target) to the linux line. Practise getting back to multi-user.target from each.
Then
Take the timed RHCSA mock exam on the Rocky Linux machine when single labs feel routine, and do one full pass of the VM tasks the week before your exam.
Questions
- Can I practise the whole RHCSA in a browser?
- Most of it. Users, permissions, services, firewalld, dnf repositories, scheduling, time sync, tuning and SSH run for real in BrokenCluster's Rocky Linux labs. SELinux, partitions, LVM, swap, booting and root recovery need a kernel and disks of your own, so practise those on a free VM.
- Which Linux should the practice VM run?
- Rocky Linux 9 or AlmaLinux 9: both are free and binary-compatible with RHEL 9, so commands, package names and file paths match the exam. A free Red Hat Developer subscription gives you real RHEL 9 too.
- Why do I need touch /.autorelabel after resetting the root password?
- passwd rewrote /etc/shadow while SELinux was not running, so the new file has no SELinux label. Without a relabel at the next boot, nobody can log in, root included.
- rd.break or init=/bin/bash?
- Both work on RHEL 9. rd.break stops in the initramfs with the real root at /sysroot (read-only); init=/bin/bash starts a shell on the real root, also read-only. Either way: remount read-write, change the password, relabel.
Fix it yourself
A live machine in your browser, already broken. The grader checks the result.
- Point dnf at the Offline Repositoriesmedium 7 min
- Boot to Text Mode by Defaulteasy 3 min
- Turn a Script Into a Servicemedium 9 min
- Open One Port, Close an Unused Servicemedium 6 min
No account needed for your first tries.
More guides
- sudo echo >> /etc/hosts: Permission denied. Why sudo didn't help
sudo runs the command as root, but the >> redirect is done by your own shell, before sudo starts. Here's why, and the three correct ways to write the file.
- No space left on device: find what is filling the disk on Linux
Which filesystem is full, which directory is growing, which files are biggest, and the space a deleted file still holds. Five commands, with real output.
- SELinux for the RHCSA: contexts, ports and booleans, practised on a VM
The SELinux tasks the RHCSA expects, in the order you'd meet them: modes, file contexts, a web server on a new port, booleans and reading denials.