2 packs: 15% off with code BUY2. 3 or more: 20% off with code BUY3.

Free Red Hat EX200 RHCSA Practice Questions

10 free Red Hat EX200 RHCSA practice tasks from the CertStash pack of 111, each with the correct answer and a full explanation. The rule is the same for every exam: ten free on the product page, 10 free here, all 111 in the pack, and each step includes the one before it.

Question 1

Show the case study this question is based on

SIMULATION

The server has a second network interface, ens224, cabled to an isolated storage network. No NetworkManager connection profile exists for ens224 yet.

Create a connection profile named storage for ens224 with the static IPv4 address 10.10.20.15/24 and no default gateway. IPv6 must be disabled on this profile, and the configuration must persist across reboots.

Completed Answer

Create a persistent connection profile named storage on ens224 with a static IPv4 address and IPv6 disabled.

Create the profile for ens224 → nmcli connection add con-name storage ifname ens224 type ethernet

Set static IPv4 and disable IPv6 → nmcli connection modify storage ipv4.method manual ipv4.addresses 10.10.20.15/24 ipv6.method disabled

Activate the profile → nmcli connection up storage

Verify the address on the interface → ip address show ens224

Verify the saved settings → nmcli -g ipv4.method,ipv4.addresses,ipv6.method connection show storage

How To Work It Out

1. Create a new Ethernet profile named storage and bind it to ens224 with nmcli connection add.

2. Change the profile to manual IPv4 addressing with 10.10.20.15/24, leave the gateway empty, and set ipv6.method to disabled in one modify command.

3. Activate the profile so the interface picks up the saved settings immediately.

4. Confirm the live address with ip address show, then read the stored values back with nmcli -g.

NetworkManager saves every profile created or changed with nmcli to disk, so no configuration file has to be edited by hand. Setting ipv4.method to manual makes NetworkManager use the address in ipv4.addresses instead of DHCP, and leaving ipv4.gateway empty keeps a second default route off the storage network. The disabled value for ipv6.method turns IPv6 off for this profile only. A modify command changes only the stored profile, so nmcli connection up applies it now, and connection.autoconnect, which is yes for a new profile, activates it again at every boot.

Show answer and explanation

The answer and explanation for this question are in the free sample PDF.

Question 2

Show the case study this question is based on

SIMULATION

Create three users: harry, natasha, and tom, according to the following requirements: harry and natasha must have the admin group as a supplementary group; tom must have a non-interactive login shell.

Completed Answer

Add three users with specific group memberships and login shell configurations using command-line tools.

Create the admin group if it does not exist yet → groupadd admin

Command to add harry to admin group → useradd -G admin harry

Command to add natasha to admin group → useradd -G admin natasha

Command to add tom with non-interactive shell → useradd -s /sbin/nologin tom

Command to verify group membership → id harry;id natasha

Command to verify tom's login shell → grep ^tom: /etc/passwd

How To Work It Out

1. Create the admin group with groupadd admin, because useradd -G only accepts a group that already exists.

2. Create harry and natasha with useradd -G admin so admin is their supplementary group.

3. Create tom with useradd -s /sbin/nologin so he has a non-interactive login shell.

4. Check the memberships with id harry and id natasha, using the exact lower-case user names.

5. Confirm tom's shell by printing his line from /etc/passwd with grep.

useradd -G only accepts groups that already exist, so admin is created first; if it is already there, groupadd just reports that and nothing changes. The -G option then sets admin as a supplementary group for harry and natasha, and -s /sbin/nologin gives tom a shell that refuses interactive logins. Linux user names are case-sensitive, so the check must be id natasha. The last field of tom's /etc/passwd line shows his login shell.

Show answer and explanation

The answer and explanation for this question are in the free sample PDF.

Question 3

SIMULATION

Create a directory named admins under /home. Its group must be the admin group. Group members must be able to read and write, while other users must not be able to access it. Files created in it by users of the same group must also belong to the admin group.

Completed Answer

Create a directory with specific permissions so the admin group can read and write, others cannot access it, and files inherit the admin group ownership.

Line 1 → cd /home/

Line 2 → mkdir admins

Line 3 → chown :admin admins/

Line 4 → chmod 770 admins/

Line 5 → chmod g+s admins/

How To Work It Out

1. Navigate to /home/ where the directory will be created.

2. Create the admins directory that will serve as the shared directory.

3. Change its group to admin with chown :admin, leaving the owner unchanged.

4. Set permissions to 770 so owner and group have full access (7) while others have no access (0).

5. Apply the setgid bit (g+s) so files created within inherit the directory's admin group instead of the creator's group.

The configuration establishes a shared directory owned by the admin group with read-write permissions only for the owner and group members (770). The setgid bit (g+s) is critical because it forces any files created within the directory to automatically inherit the admin group as their group owner, rather than defaulting to the creator's primary group. This ensures consistent group ownership for all content in the directory while preventing access from other users.

Show answer and explanation

The answer and explanation for this question are in the free sample PDF.

Question 4

SIMULATION

Configure a scheduled task to run the echo hello command at 14:23 every day.

Completed Answer

Configure a cron job to execute the echo hello command every day at 14:23 (2:23 PM).

Line 1 → which echo

Line 2 → crontab -e

Line 3 → 23 14 * * * /bin/echo hello

Line 4: Verify → crontab -l

How To Work It Out

1. First, verify the location of the echo command using which to ensure the correct path.

2. Open the crontab editor with crontab -e to create or modify the scheduled task.

3. Enter the cron expression with minute 23, hour 14 (24-hour format), and asterisks for day, month, and day-of-week to run daily at 14:23.

4. After saving, verify the cron job was created successfully by listing the crontab entries with crontab -l.

Cron uses a five-field format: minute hour day month day-of-week. To run a command at 14:23 every day, set the minute field to 23 and the hour field to 14 (in 24-hour format), with asterisks in the remaining fields to match every day of every month. A full path is used for the command; on RHEL 10 /bin is a link to /usr/bin, so /bin/echo is the same file that which reports as /usr/bin/echo. The crontab -e command opens the editor, and crontab -l verifies the job was saved correctly.

Show answer and explanation

The answer and explanation for this question are in the free sample PDF.

Question 5

SIMULATION

Find all files owned by harry and copy them to the directory /opt/dir.

Completed Answer

Find all files owned by the user harry and copy them to the /opt/dir directory.

Line 1 → cd /opt/

Line 2 → mkdir dir

Line 3 → find / -user harry -exec cp -rfp {} /opt/dir/ \;

How To Work It Out

1. Change to the /opt/ directory to establish the working location where the target directory will be created.

2. Create the destination directory called 'dir' inside /opt/ to prepare the location for copied files.

3. Use find command with -user harry to search the entire filesystem for files owned by harry, then use -exec with cp -rfp to recursively copy those files with preserved permissions to /opt/dir/.

The solution requires three sequential steps. First, navigate to /opt/ where the destination will be created. Second, create the 'dir' subdirectory to serve as the target location. Third, use find / -user harry to search all directories starting from root for files owned by the user harry. The -exec cp -rfp {} /opt/dir/ \; clause executes a copy command for each found file, where -r copies recursively, -f forces overwrite, and -p preserves file attributes. The {} placeholder represents each found file and the backslash-escaped semicolon terminates the -exec action.

Show answer and explanation

The answer and explanation for this question are in the free sample PDF.

Question 6

SIMULATION

Find all lines containing the string abcde in the file /etc/testfile and write them to the file /tmp/testfile. The lines must appear in the same order as in /etc/testfile.

Completed Answer

Write a command to find all lines containing 'abcde' from /etc/testfile and write them to /tmp/testfile while preserving the original sequence.

Command to execute → grep 'abcde' /etc/testfile > /tmp/testfile

How To Work It Out

1. The task requires searching for lines containing the pattern 'abcde' in the source file /etc/testfile.

2. grep is the appropriate tool for pattern matching and line filtering.

3. The output must be written to /tmp/testfile, which requires output redirection using > (overwrite mode).

4. The > operator writes all matching lines to the destination file in the order they appear in the source, preserving sequence.

The grep command searches for lines matching 'abcde' in /etc/testfile. The > redirection operator sends these matching lines to /tmp/testfile, creating or overwriting the file. grep reads the file from top to bottom and prints each matching line as soon as it finds it, so the lines reach /tmp/testfile in exactly the order they have in /etc/testfile, with nothing added or reordered.

Show answer and explanation

The answer and explanation for this question are in the free sample PDF.

Question 7

Show the case study this question is based on

SIMULATION

Create a 2G swap partition that activates automatically at boot, without affecting the existing swap partition.

Completed Answer

Create a new 2G swap partition that activates at boot without affecting the existing swap partition.

Open the disk in fdisk → fdisk /dev/sda fdisk: print the partition table → p fdisk: add a new partition → n fdisk: last sector (Enter accepts the default first sector) → +2G fdisk: change the partition type → t fdisk: Linux swap type code (MBR disk) → 82 fdisk: write the table and exit → w

Tell the kernel about the new partition → partx -a /dev/sda

Format the new partition (/dev/sda8 here) as swap → mkswap /dev/sda8

Add a UUID swap entry to /etc/fstab → echo "UUID=$(blkid -s UUID -o value /dev/sda8) none swap defaults 0 0" >> /etc/fstab

Activate all fstab swap entries → swapon -a

Verify both swap areas are active → swapon --show

How To Work It Out

1. Open /dev/sda with fdisk and print the table with p to see the existing partitions, including the current swap.

2. Add a partition with n, press Enter for the default first sector and give +2G as the last sector; on this disk it becomes /dev/sda8.

3. Change its type with t, accept the default partition number, enter 82 for Linux swap, then save with w.

4. Run partx -a /dev/sda so the kernel sees the new partition, then format it with mkswap /dev/sda8.

5. Append a UUID line for /dev/sda8, built with blkid, to /etc/fstab so the swap is enabled at every boot.

6. Run swapon -a to enable it now, and check with swapon --show that both swap areas are active.

fdisk creates the 2G partition, and type 82 marks it as Linux swap on this MBR disk. partx -a adds the new partition to the kernel's view without a reboot, and mkswap writes the swap signature. The fstab line names the partition by UUID, with none in the mount point field, so it is activated at every boot even if device names change. swapon -a enables every fstab swap entry that is not already active, so the original swap partition is left untouched.

Show answer and explanation

The answer and explanation for this question are in the free sample PDF.

Question 8

SIMULATION

Create a user named alex with the user ID 1234 and the password alex111.

Completed Answer

Create a user named alex with user ID 1234 and set the password to alex111.

Command 1 → useradd -u 1234 alex

Command 2 → passwd alex

First password prompt response → alex111

Second password prompt response → alex111

How To Work It Out

1. Use useradd with the -u flag to specify the user ID 1234 and create the user named alex.

2. Execute passwd alex to enter the password change mode for the newly created user.

3. When prompted for the new password, type alex111.

4. When prompted to confirm the password, retype alex111 to verify it matches.

To create a user with a specific user ID in Linux, the useradd command with the -u option is required. The useradd -u 1234 alex command creates the user alex with UID 1234. The passwd command then allows setting the password interactively by prompting twice to confirm the password matches. Both prompts must receive alex111 for the password to be successfully set.

Show answer and explanation

The answer and explanation for this question are in the free sample PDF.

Question 9

Show the case study this question is based on

SIMULATION

On servera.lab.example.com, create the shell script /root/svccheck.sh. When it runs, it must check whether the sshd service is active. If it is, the script prints sshd is running and exits with status 0. Otherwise it prints sshd is NOT running and exits with status 1.

The decision must be made with an if statement that tests the exit status of a command, not by parsing command output. The script must be executable, and you must run it once to confirm it works.

Completed Answer

Write an executable Bash script that uses if/else on the exit status of systemctl is-active to report whether sshd is running.

Script /root/svccheck.sh, line 1 → #!/bin/bash

Script line 2 → if systemctl is-active --quiet sshd; then

Script line 3 → echo "sshd is running"

Script line 4 → else

Script line 5 → echo "sshd is NOT running"; exit 1

Script line 6 → fi

Make the script executable → chmod +x /root/svccheck.sh

Test run and show the exit status → /root/svccheck.sh; echo $?

How To Work It Out

1. Start the file with the #!/bin/bash interpreter line so the kernel runs it with Bash.

2. Use systemctl is-active --quiet sshd as the if condition, because it returns status 0 only when the unit is active and prints nothing with --quiet.

3. In the then branch print sshd is running; in the else branch print sshd is NOT running and exit with status 1, then close the block with fi.

4. Add the execute bit with chmod +x so the script can be run by its path.

5. Run the script and echo $? to see the message and the exit status, which is 0 while sshd is running.

The if keyword runs a command and branches on its exit status: zero selects the then list, anything else selects the else list. systemctl is-active returns 0 when the unit is active and non-zero otherwise, and --quiet suppresses the printed state so only the script's own messages appear. When sshd is running, the last command executed is the echo in the then branch, so the script ends with status 0; the else branch sets status 1 explicitly with exit 1. chmod +x lets root execute the file directly by path.

Show answer and explanation

The answer and explanation for this question are in the free sample PDF.

Question 10

Show the case study this question is based on

SIMULATION

The file /root/newusers.txt on servera.lab.example.com contains one user name per line: bob, carol, dave and erin. The account bob already exists.

Create the script /root/mkusers.sh that uses a for loop to read every name in /root/newusers.txt. For each name, if the account already exists the script prints NAME exists; otherwise it creates the account with useradd and prints NAME created.

Make the script executable, run it once, and confirm that carol, dave and erin now exist.

Completed Answer

Write a Bash for loop that reads user names from a file and creates only the accounts that do not already exist.

Script /root/mkusers.sh, line 1 → #!/bin/bash

Script line 2 → for u in $(cat /root/newusers.txt); do

Script line 3 → if getent passwd "$u" > /dev/null; then echo "$u exists"; else useradd "$u" && echo "$u created"; fi

Script line 4 → done

Make the script executable → chmod +x /root/mkusers.sh

Run the script → /root/mkusers.sh

Verify the new accounts → getent passwd carol dave erin

How To Work It Out

1. Begin the script with #!/bin/bash.

2. Feed the loop with $(cat /root/newusers.txt) so each name in the file becomes one iteration of the variable u.

3. Inside the loop, test whether the account exists with getent passwd, which returns status 0 for a known user and 2 for an unknown one, and either report it or create it with useradd.

4. Close the loop with done and make the script executable with chmod +x.

5. Run the script: bob is reported as existing and the other three are created, which getent passwd carol dave erin confirms.

The command substitution $(cat /root/newusers.txt) expands to the file's contents, and word splitting turns each name into one item of the for list, so the body runs once per user. getent passwd queries the account database and exits 0 when the name is found or 2 when it is not, which makes it a clean if condition; its output is discarded to /dev/null. The && after useradd prints the created message only if the account was really added. Running the loop again is safe because existing accounts are skipped.

Show answer and explanation

The answer and explanation for this question are in the free sample PDF.

That was 10 of 111.

The full Red Hat EX200 RHCSA pack has all 111 tasks, each with the answer, the explanation and why the other options are wrong, plus a questions-only copy for timed runs. US$39, paid once, with free monthly updates and a pass-or-your-money-back guarantee.

Get the full pack

Not ready yet? Get the first 55 free as one PDF by email. Get the Half Pack →

What people say about the full EX200 pack 4.6 from 19

Thank you bro, I received a score of 300/300 which was really awesome. Finaly I got to pass the exam that was really tough. Thanks for the dumps and the exam questions you sent me to help me prepare. Hope will get more guidance from you again.
RMTEX200
Useful EX200 training material and useful for preparing for the EX200 exam. I passed yesterday. Thanks for your vaild help!
NormanEX200
I passed the exams of EX200 exam with 90% marks today, I am really glad for such remarkable performance. Thanks EX200 study dumps.
MooreEX200