All Red Hat exams
Free EX200 practice test: 30 questions with answers
30 original questions for Red Hat Certified System Administrator (RHCSA) exam, drawn from every topic area. Answer each one to see whether you got it right and why. No sign-up.
- Free questions
- 30
- Full bank
- 100 questions
All 30 EX200 questions with answers
The same questions as the test above, grouped by exam topic. Open any question to see the answer and explanation.
Deploy, configure, and maintain systems (4 questions)
Question 1
An administrator must set the hostname of a RHEL server persistently to server1.example.com. Which command does this?
- Ahostname server1.example.com, lost after next reboot
- Bnmcli hostname change, then restart NetworkManager
- Cecho server1.example.com > /tmp/hostname, then reboot
- Dhostnamectl set-hostname server1.example.com
Show answer and explanationHide answer
Correct answer: Dhostnamectl set-hostname stores the hostname persistently. Temporary files, hostname -f displays names, and nmcli hostname is not the command.
Question 2
A RHEL system must schedule a script to run every day at 02:30 for the user backup. Which approach is correct?
- Als -l /etc/cron.d, which displays existing jobs
- Bat now for every day, queuing a one-time job at 02:30
- Ccrontab -e for the user with the entry 30 2 * * * /path/script
- Dreboot the host each morning by editing /etc/rc.local
Show answer and explanationHide answer
Correct answer: CA cron entry with minute 30 and hour 2 runs daily at 02:30. at runs one-time jobs, listing directories does not schedule, and rebooting is not a schedule.
Question 3
A one-time task must run at 18:00 today. Which scheduling tool is most appropriate?
- Acrontab -l
- Bsystemctl list-timers only
- Cat 18:00
- Dchronyc sources
Show answer and explanationHide answer
Correct answer: Cat schedules a one-time job at a specified time. crontab -l lists entries, systemctl list-timers shows timers, and chronyc sources shows time sources.
Question 4
A RHEL server must synchronize its time with an NTP server. Which service and tool are typically used?
- Atimedatectl set-time 10:30:00 as a manual step
- Bcron jobs that call date -s hourly
- Cchronyd with chronyc to check sources
- Dntpd with manual date -s changes, no polling
Show answer and explanationHide answer
Correct answer: Cchronyd is the default NTP implementation on RHEL and chronyc checks sources. The other options do not provide ongoing synchronization.
Operate running systems (4 questions)
Question 5
A server must start the httpd service now and enable it to start at boot. Which systemctl commands accomplish this?
- Asystemctl reload-daemon httpd
- Bsystemctl stop httpd and systemctl disable httpd
- Csystemctl start httpd and systemctl enable httpd
- Dsystemctl status httpd only
Show answer and explanationHide answer
Correct answer: Cstart runs the service now and enable configures it at boot. Stop and disable reverse these actions, status only reports, and reload-daemon is not the correct command.
Question 6
A process is consuming excessive CPU and must be stopped by its PID. Which command sends a termination signal to the process?
- Akill PID
- Bls PID
- Cgrep PID
- Dcat PID
Show answer and explanationHide answer
Correct answer: Akill sends a signal, by default SIGTERM, to a PID. The other commands do not signal processes.
Question 7
An administrator wants to change the default target of a server so it boots into a non-graphical multi-user mode. Which command sets this?
- Asystemctl isolate graphical.target only
- Bchmod 755 /boot
- Creboot now
- Dsystemctl set-default multi-user.target
Show answer and explanationHide answer
Correct answer: Dset-default multi-user.target sets the boot target to non-graphical multi-user mode. Isolating a target changes it immediately without setting the default, rebooting does not change the default, and chmod is unrelated.
Question 8
Which TWO commands show disk usage on a RHEL system? (Choose two.)
- Auptime
- Bdf -h
- Cdu -sh /path
- Dfree -m
- Eps aux
Show answer and explanationHide answer
Correct answer: B, Cdf -h reports file system usage and du -sh reports directory sizes. free shows memory, ps lists processes, and uptime shows load.
Configure local storage (4 questions)
Question 9
A new disk /dev/sdb must be partitioned with a single partition using GPT. Which tool is most appropriate for creating the partition table and partition?
- Aparted or gdisk to create a GPT partition table and partition
- Bfdisk to format a file system directly without a table
- Cmkfs to build an ext4 file system on /dev/sdb without partitioning at once
- Dmount -t ext4 -o noatime,nodiratime /dev/sdb1 /srv/data/archive/volume
Show answer and explanationHide answer
Correct answer: Aparted or gdisk creates GPT partition tables and partitions. mkfs formats file systems, and mount attaches them; neither creates the partition table.
Question 10
After creating a partition, an administrator wants to format it with the XFS file system. Which command is correct?
- Amkfs.ext2 /dev/sdb1 with the xfs label
- Bmkfs.xfs /dev/sdb1
- Cformat /dev/sdb1 xfs
- Dmount -t xfs /dev/sdb1 /mnt
Show answer and explanationHide answer
Correct answer: Bmkfs.xfs formats the partition with XFS. The others use the wrong tool or do not format the device.
Question 11
A file system must be mounted automatically at boot using its UUID. Which file must be edited?
- A/etc/fstab
- B/etc/hosts
- C/etc/motd
- D/etc/issue
Show answer and explanationHide answer
Correct answer: A/etc/fstab defines persistent mounts, including by UUID. The other files do not control mounts.
Question 12
An administrator needs to create a logical volume of 10 GB in a volume group named vg_data. Which command achieves this?
- Alvcreate -L 10G -n lv_app vg_data
- Bpvcreate --metadatasize 250k /dev/sdb1
- Cmkfs.xfs -L app /dev/vg_data/lv_app
- Dvgcreate -s 16M vg_backup2
Show answer and explanationHide answer
Correct answer: Alvcreate with -L sets the size, -n names the LV, and the VG is given at the end. vgcreate creates volume groups, mkfs formats file systems, and pvcreate prepares physical volumes.
Create and configure file systems (4 questions)
Question 13
An administrator must create a directory /shared that is shared by a group named devs, where new files inherit the group. Which configuration achieves this?
- Achown root /shared without group changes
- Brm -rf /shared
- Cchmod 777 /shared only
- Dchgrp devs /shared and chmod g+s /shared
Show answer and explanationHide answer
Correct answer: Dchgrp sets the group and the setgid bit makes new files inherit it. World-writable permissions are unsafe, root ownership alone does not share with devs, and deletion removes the directory.
Question 14
A directory must contain files that cannot be deleted or renamed by anyone except root, even if the directory is writable by others. Which permission bit applies?
- ASticky bit on the directory
- BRead-only attribute for all users
- CNo permissions at all
- DSetuid bit on the directory
Show answer and explanationHide answer
Correct answer: AThe sticky bit restricts deletion to the file owner and root. Setuid applies to executables, read-only attributes do not restrict this way, and no permissions block everyone.
Question 15
A file needs read and write permissions for its owner, read for the group, and no access for others. Which numeric mode represents this?
- A755
- B640
- C777
- D600
Show answer and explanationHide answer
Correct answer: B640 gives owner rw, group r and others none. 755 gives others read and execute, 777 gives full access to all, and 600 denies the group read.
Question 16
An administrator needs to create a hard link to a file so that both names refer to the same inode. Which command is correct?
- Acp source link
- Bmv source link
- Cln source link
- Dln -s source link only
Show answer and explanationHide answer
Correct answer: Cln creates a hard link that shares the inode. ln -s creates a symbolic link, cp creates a copy, and mv renames or moves the file.
Manage security (4 questions)
Question 17
Which THREE steps are part of configuring a persistent static network connection with nmcli on RHEL? (Choose three.)
- ACreating or modifying a connection profile with nmcli connection add or modify
- BEditing /etc/hosts to assign the interface address
- CRestarting the hostname service to apply the address
- DSetting the IP address, prefix, and gateway on the profile
- EBringing the connection up with nmcli connection up
Show answer and explanationHide answer
Correct answer: A, D, Enmcli profiles store persistent settings, and the connection must be brought up. /etc/hosts maps names and does not assign interface addresses, and hostname restarts do not configure IPs.
Question 18
Which TWO are valid SELinux-related commands or checks? (Choose two.)
- Agetenforce
- Bls -l to view SELinux labels only
- Cchmod 777 to fix a denied SELinux context
- DDeleting the SELinux policy directory to disable it
- Esetsebool -P with a boolean name
Show answer and explanationHide answer
Correct answer: A, Egetenforce reports the mode and setsebool -P sets persistent booleans. Opening permissions to fix denials and deleting policy are unsafe, and ls -l does not show the full picture of labels and policy.
Question 19
A file must be made immutable so that even root cannot modify it until the attribute is removed. Which command sets this?
- Asetfacl -b file
- Bchattr +i file
- Cchmod 777 file
- Dchown nobody file
Show answer and explanationHide answer
Correct answer: Bchattr +i makes a file immutable at the file system level. chmod 777 opens permissions, chown changes owner, and setfacl -b removes ACLs.
Question 20
An administrator needs to verify which SELinux context a file has. Which command shows this?
- Als -Z file
- Bstat -c file only
- Cchmod -c file
- Dls -l file only
Show answer and explanationHide answer
Correct answer: Als -Z displays SELinux contexts. ls -l shows permissions, chmod changes modes, and stat without the context flag does not show SELinux labels.
Manage users and groups (4 questions)
Question 21
An administrator must create a user named bob with a home directory and the group sales as a supplementary group. Which command achieves this?
- Agroupadd -r -g 1002 sales
- Bpasswd -G sales bob
- Cuseradd -m -G sales bob
- Dusermod -d bob sales
Show answer and explanationHide answer
Correct answer: Cuseradd -m creates the home directory and -G adds supplementary groups. groupadd creates groups, passwd sets passwords, and usermod -d changes the home path.
Question 22
A user account must expire on 2026-12-31. Which command sets the expiration date?
- Apasswd -x 2026 user
- Bchage -E 2026-12-31 user
- Cid -E 2026-12-31 user
- Duseradd -e 2026 user only
Show answer and explanationHide answer
Correct answer: Bchage -E sets the account expiry date. useradd sets expiry only at creation with -e, passwd -x sets maximum password age, and id only displays identity information.
Question 23
A password policy requires that users change their password every 90 days. Which command sets this for an existing user?
- Agroupadd -M 90 user
- Bpasswd -l 90 user
- Cusermod -p 90 user
- Dchage -M 90 user
Show answer and explanationHide answer
Correct answer: Dchage -M sets the maximum password age. passwd -l locks an account, usermod -p sets an encrypted password, and groupadd creates groups.
Question 24
A group named support must be created, and the user carol must be added to it as a supplementary group. Which commands accomplish this?
- Achown -hR support:support /home/carol/.config/mail
- Bgroupadd support then usermod -aG support carol
- Cpasswd -x 90 -w 7 -i 30 -G support carol
- Dgroupadd carol then useradd -G support -s /bin/bash
Show answer and explanationHide answer
Correct answer: Bgroupadd creates the group and usermod -aG appends the user to the group. The other sequences do not add carol to support correctly.
Understand and use essential tools (3 questions)
Question 25
An administrator needs to find all files under /etc that were modified in the last 24 hours. Which command is appropriate?
- Afind /etc -type f -mtime -1
- Bls -la /etc --time-style=long-iso
- Cgrep -rn 'modified' /etc/ssh/*
- Dcat /etc/hosts /etc/fstab | head
Show answer and explanationHide answer
Correct answer: Afind with -mtime -1 selects files modified within the last day. grep searches file content, ls lists one directory, and cat prints file content.
Question 26
An administrator must create a compressed archive of /home/student with gzip compression. Which command is correct?
- Azip -r9 student.zip student
- Bgzip -dk /home/student/backup.tar.gz
- Ctar -xzf home.tar.gz -C /restore/student
- Dtar -czf home.tar.gz /home/student
Show answer and explanationHide answer
Correct answer: Dtar -czf creates a gzip-compressed archive. Extraction uses -x, gzip -d decompresses single files, and the zip syntax here is not a tar operation.
Question 27
An administrator must create a new file named report.txt in the current directory and immediately view its contents. Which pair of commands accomplishes this?
- Arm -f ./report.txt then echo file removed
- Btouch report.txt then cat report.txt
- Ccp -p report.txt /var/backups/
- Dmkdir -p report.txt then ls -l
Show answer and explanationHide answer
Correct answer: Btouch creates an empty file and cat displays it. mkdir creates directories, rm deletes, and cp copies an existing file.
Manage containers (3 questions)
Question 28
An administrator must run a container named web from the image registry.example.com/httpd, detached and with port 8080 mapped to the container's port 80, using Podman. Which command does this?
- Apodman run -d --name web -p 8080:80 registry.example.com/httpd
- Bpodman container rm --force --volumes --ignore --time 30 --log-level=error web
- Cdocker-compose -f compose.yaml up -d --build --wait web
- Dpodman start --attach --interactive --detach-keys=ctrl-p --time 10 8080
Show answer and explanationHide answer
Correct answer: Apodman run with -d, --name and -p maps ports and runs detached. podman start needs an existing container, docker-compose is not the Podman command, and remove deletes containers.
Question 29
A rootless Podman user needs their containers to keep running after logout. Which command enables this?
- Asystemctl stop user@1000.service --now
- Bpodman system reset --force
- Cchmod 000 ~/.config/systemd
- Dloginctl enable-linger username
Show answer and explanationHide answer
Correct answer: DEnabling linger keeps the user's systemd session and containers running after logout. Stopping the user manager ends them, resetting Podman removes data, and chmod 000 breaks configuration access.
Question 30
A Podman container must be configured to start automatically on boot. Which approach is recommended on RHEL?
- AGenerate a systemd unit for the container and enable it
- BRun the container once manually with podman run in the foreground
- CAdd the container command to /etc/motd at login
- DPut the container name in /etc/hosts with its IP and published port
Show answer and explanationHide answer
Correct answer: AGenerating a systemd unit for the container and enabling it starts it at boot. A motd line, a single manual run and hosts entries do not start containers.