Limited-Time Offer: Enjoy 50% Savings! Coupon code: 50OFF Use it at checkout
Skip to content

Free RedHat Red Hat Certified System Administrator EX200 Exam Questions

Last updated: · 15 practice questions with answers and explanations

Page: 1 / 14 Total 136 questions

Want more questions? Get Premium Access.

Question 1

New Single answer

Topic: Understand and use essential tools

Skill tested: Use SSH, grep, and redirection to filter a remote log and save matching lines locally.

An operations engineer must collect every line containing the case-sensitive string `timeout` from `/var/log/edge.log` on `edge01`. The source log must remain unchanged, and the filtered results must be saved as `/srv/cases/edge-timeouts.txt` on the engineer's current host. SSH access is already configured, and the destination directory exists. Which command performs the task without copying the entire remote log first?

Correct Answer: A. ssh edge01 'grep timeout /var/log/edge.log' > /srv/cases/edge-timeouts.txt
Explanation:

The remote shell runs `grep` against the remote log and writes matching lines to standard output. The local shell receives that output through SSH, and its `>` redirection creates or replaces the destination file on the engineer's host. The source log is only read. In B, the redirection is inside the remote command, so it writes to a path on `edge01`, not locally. C treats an SSH-style path as a local grep operand. D redirects output back into the remote source log and risks corrupting it.

Question 2

New Single answer

Topic: Create simple shell scripts

Skill tested: Write a POSIX shell loop that processes each positional file argument safely.

A maintenance team needs a portable `/bin/sh` script that accepts one or more file names as positional arguments and prints the line count for each file. File names may contain spaces, and the script should not treat all arguments as one name. The files are supplied by the caller; no directory traversal or shell-specific features are required. Which loop correctly iterates over the supplied arguments while preserving each file name?

Correct Answer: B. for file in "$@"; do wc -l "$file"; done
Explanation:

In POSIX shell, `"$@"` expands to one separately quoted word for each positional parameter, preserving spaces within an argument. Quoting `"$file"` also prevents word splitting and pathname expansion when the variable is used. A leaves `$*` unquoted and can split names containing spaces. C combines all parameters into one word and then expands `$file` unsafely. D reads standard input rather than iterating over the script's positional parameters.

Question 3

New Multiple answers

Topic: Operate running systems

Skill tested: Set a systemd boot target, inspect journal logs, and enable a service for persistent startup.

A RHEL server is currently configured to boot to a graphical environment, but a workload appliance must start in multi-user mode after every reboot. Its `inventory-sync.service` has failed during the last boot, and the administrator needs the associated journal entries before making any service-specific repair. The service must also start automatically on future boots. Select TWO commands that directly satisfy these requirements without immediately changing the current running session.

Correct Answer: A. Run `journalctl -u inventory-sync.service -b`.; B. Run `systemctl set-default multi-user.target`.
Explanation:

`systemctl set-default multi-user.target` changes the default target used for subsequent boots; it does not switch the current session immediately. `journalctl -u inventory-sync.service -b` filters journal entries for that unit from the current boot, providing the requested failure evidence. `isolate` changes the current system's active target, which the scenario excludes. `start` attempts a runtime start but does not configure future boot behavior. `enable` persists startup configuration, but the question asks for two commands addressing the specified boot target and log inspection.

Question 4

New Single answer

Topic: Operate running systems

Skill tested: Restart a failed network service and configure it to start automatically after reboot.

A RHEL host's NetworkManager service has stopped after a configuration change. The host is reachable through an out-of-band console, and the updated connection profile is already valid. The administrator must restore network management now and ensure the service is started on subsequent boots. Which action best meets both requirements?

Correct Answer: C. Run `systemctl enable --now NetworkManager`.
Explanation:

`systemctl enable --now NetworkManager` both enables the unit for future boots and starts it immediately, addressing the current outage as well as persistence. Enabling alone, as in A, does not start a stopped service now. Restarting in B restores runtime operation but does not configure boot-time activation. `daemon-reload` makes systemd reread unit files; it neither starts nor enables the service, and no unit-file change is stated.

Question 5

New Multiple answers

Topic: Configure local storage

Skill tested: Create an LVM physical volume and extend a volume group without modifying existing logical volumes.

A RHEL file server has a volume group named `vgdata` containing a logical volume and an XFS filesystem that must remain intact. A newly attached, empty 20 GiB disk is visible as `/dev/sdb`; the administrator has verified its identity and must add its capacity to `vgdata` without recreating or formatting existing storage. Which TWO commands perform the required LVM preparation and group expansion?

Correct Answer: A. Run `pvcreate /dev/sdb`.; C. Run `vgextend vgdata /dev/sdb` after creating the physical volume.
Explanation:

LVM must first recognize the new device as a physical volume with `pvcreate`; then `vgextend` adds that PV's extents to the existing volume group. This increases available VG capacity without altering the existing LV or filesystem. B attempts to add a device before PV initialization. Creating a new LV in D is not required to add the disk to the group and could allocate the free extents rather than simply completing the requested expansion. Formatting the existing LV in E would destroy its filesystem data.

Question 6

New Single answer

Topic: Configure local storage

Skill tested: Create a logical volume from available volume-group extents without overwriting existing logical volumes.

A storage administrator has initialized an unused disk as a physical volume and added it to `vgapps`. The group now reports 12 GiB free, while its existing logical volumes and filesystems must remain untouched. A new 8 GiB logical volume named `lvreports` is required for a later filesystem deployment. Which command creates only that logical volume and preserves the existing allocations?

Correct Answer: A. `lvcreate -L 8G -n lvreports vgapps`
Explanation:

`lvcreate -L 8G -n lvreports vgapps` allocates the specified size from free extents in `vgapps` and gives the new LV the requested name. The remaining free capacity and existing logical volumes are not reformatted or replaced. B consumes all currently free extents rather than creating the requested 8 GiB volume. C is not an LV creation command and should not be used on an LVM device path. D attempts to create a filesystem on a device that does not yet exist and would not perform LV allocation.

Question 7

New Single answer

Topic: Create and configure file systems

Skill tested: Create an XFS filesystem and mount it persistently using an fstab UUID entry.

A newly created logical volume `/dev/vgshared/lvteam` is empty and must hold team data. The administrator needs an XFS filesystem mounted at `/srv/team` after every boot. Device names can change in future hardware maintenance, so the persistent configuration must identify the filesystem by a stable filesystem identifier. Which sequence is most appropriate?

Correct Answer: A. Run `mkfs.xfs /dev/vgshared/lvteam`, obtain its UUID with `blkid`, add a UUID-based entry to `/etc/fstab`, then mount it.
Explanation:

The empty LV can be formatted as XFS, after which `blkid` supplies the filesystem UUID for a stable `/etc/fstab` entry. Mounting after validating the entry makes the filesystem available now and at boot. B uses a device path despite the stated stability requirement and omits the required filesystem creation. C creates an ext4 filesystem but declares it as XFS, an incompatible configuration. `xfs_repair` in D is a repair utility, not a filesystem-creation command, and a manual mount alone is not persistent.

Question 8

New Multiple answers

Topic: Create and configure file systems

Skill tested: Configure set-GID collaboration directories and verify effective group permissions.

A design group named `render` shares files in `/srv/render`. New files and subdirectories should inherit the directory's group ownership so collaborators do not accidentally create content under their primary groups. Group members need write access, while users outside the group must not receive access. The filesystem is already mounted and the directory exists. Select TWO actions that establish and verify these collaboration properties.

Correct Answer: C. Apply mode `2770` to `/srv/render`.; D. Set the directory group to `render` with `chgrp render /srv/render`.
Explanation:

Changing the directory's group to `render` and applying mode `2770` gives the owner and group full access, denies access to others, and sets the set-GID bit. On a directory, set-GID causes newly created entries to inherit the directory's group, supporting team collaboration. Mode `0755` permits outsiders to read and traverse and does not establish the needed group write behavior. The sticky bit limits deletion behavior; it does not provide set-GID inheritance. Inspecting only owner permissions cannot verify the relevant group mode.

Question 9

New Single answer

Topic: Deploy, configure, and maintain systems

Skill tested: Install a package from configured repositories and enable its service at boot.

A RHEL web node needs the `httpd` package from the organization's configured remote repositories. Repository configuration is already available, and no local RPM file is supplied. After installation, the service must launch automatically on future boots; the administrator also wants it running now for a deployment test. Which approach is most direct?

Correct Answer: A. Use `dnf install httpd` and then `systemctl enable --now httpd`.
Explanation:

`dnf install httpd` resolves and installs the package using configured repositories. `systemctl enable --now httpd` both enables the unit for future boots and starts it immediately for the deployment test. `rpm -i` expects an RPM file and does not resolve repository dependencies in the way requested. Starting or enabling a service before installing its package, as in C, cannot work when the unit is absent. Downloading the RPM alone in D does not install it, and starting it does not make it persistent.

Question 10

New Single answer

Topic: Deploy, configure, and maintain systems

Skill tested: Schedule recurring maintenance with a systemd timer and a correctly ordered service unit.

A platform team must run `/usr/local/sbin/rotate-app-data` every day at 02:15 on a RHEL host. The job should be managed by systemd, leave its output in the journal, and run after reboot even if the host was powered off at its scheduled time, where supported by timer catch-up behavior. Which design is most appropriate?

Correct Answer: C. Create a oneshot service that runs the script, pair it with a timer using `OnCalendar=daily`, `Persistent=true`, and enable the timer.
Explanation:

A systemd timer activates a service according to its calendar schedule; the service can be a `Type=oneshot` unit that executes the script, with stdout and stderr captured by the journal by default. `Persistent=true` on a calendar timer allows a missed activation to be triggered when the timer becomes active again. Enabling the timer makes scheduling persistent across boots. Enabling only the service in B does not schedule recurring execution; C describes a boot-relative delay rather than the requested daily wall-clock time. A long-running sleep loop is less reliable and harder to manage.

Question 11

New Single answer

Topic: Manage basic networking

Skill tested: Configure persistent IPv4 addressing and DNS through a NetworkManager connection profile.

A RHEL server managed by NetworkManager must use IPv4 address `192.0.2.44/24`, default gateway `192.0.2.1`, and DNS server `192.0.2.53` after every reboot. The active connection profile is named `prod-lan`; the address must not be configured with a temporary `ip` command, and the administrator wants NetworkManager to apply the profile change. Which command sequence best satisfies the requirement?

Correct Answer: A. Use `nmcli con mod prod-lan ipv4.method manual ipv4.addresses 192.0.2.44/24 ipv4.gateway 192.0.2.1 ipv4.dns 192.0.2.53`, then reactivate the profile with `nmcli con up prod-lan`.
Explanation:

`nmcli con mod` stores the address, gateway, DNS server, and manual IPv4 method in the named NetworkManager profile, making the configuration persistent. Bringing the connection up reapplies the modified profile. Direct `ip` commands in B are runtime-only, while replacing `resolv.conf` may conflict with NetworkManager management. Leaving the method as automatic in C does not clearly configure a static profile and omits gateway and DNS requirements. D changes runtime routing only and does not configure the persistent profile.

Question 12

New Single answer

Topic: Manage users and groups

Skill tested: Create a user, assign supplementary group membership, and set password aging limits.

A new RHEL operator needs an account named `mira` and supplementary membership in the existing `ops` group. Company policy requires passwords to expire after 90 days, with a warning beginning 14 days before expiration. The account must retain its normal primary group and must not receive administrator privileges beyond the group assignment. Which command sequence best implements the request?

Correct Answer: C. Run `useradd -G ops mira`, then `chage -M 90 -W 14 mira`.
Explanation:

`useradd -G ops mira` adds `ops` as a supplementary group while leaving the account's normal primary-group behavior intact. `chage -M 90 -W 14 mira` sets a 90-day maximum password age and a 14-day warning period. Using `-g ops` in B makes `ops` the primary group and reverses the aging values. Adding `mira` to `wheel` in C grants an unrequested privileged group membership and omits the warning setting. D creates a group rather than the requested user.

Question 13

New Multiple answers

Topic: Manage users and groups

Skill tested: Grant scoped sudo access and apply account password-aging policy with appropriate tools.

A database support user named `devon` must be allowed to run `/usr/bin/systemctl restart postgresql` with sudo, but must not receive unrestricted administrative access. The account already exists and should have a 60-day maximum password age and a 10-day warning period. The configuration must be auditable and should avoid editing the main sudoers file directly. Select TWO actions that meet the requirements.

Correct Answer: B. Run `chage -M 60 -W 10 devon`.; D. Use `visudo -f /etc/sudoers.d/devon` to add a rule permitting `devon` to run only `/usr/bin/systemctl restart postgresql`.
Explanation:

A separately managed sudoers drop-in edited with `visudo -f` provides an auditable, syntax-checked location for a narrowly scoped command rule. The rule should identify the permitted command with its full path and avoid granting `ALL` commands. `chage -M 60 -W 10 devon` applies the specified maximum age and warning interval. Membership in `wheel` commonly grants broader sudo rights than requested. Locking the account or disabling its shell is unrelated and would impair access; direct unvalidated editing of the main sudoers file risks syntax errors.

Question 14

New Single answer

Topic: Manage security

Skill tested: Configure SSH public-key authentication and correct SELinux file contexts using restorecon.

A developer must authenticate to a RHEL host with an SSH key rather than a password. The developer's home directory already contains the matching public key at `.ssh/authorized_keys`, but SSH key authentication fails because permissions were loosened during a migration. Separately, a web site's content has been moved to `/srv/www/site`, and SELinux is enforcing; the files retain a generic context instead of the web content context. Which remediation best addresses both problems using standard RHEL mechanisms?

Correct Answer: D. Set restrictive ownership and permissions on the user's home, `.ssh`, and `authorized_keys`; then run `restorecon -Rv /srv/www/site`.
Explanation:

OpenSSH may reject public-key authentication when the user's key files or containing directories are writable by unauthorized users; appropriate ownership and restrictive permissions restore the expected trust chain. `restorecon` reapplies the policy-defined SELinux contexts for the web content location while leaving SELinux enforcing. Disabling SELinux or making the key world-writable weakens security. `chcon` changes labels without the policy-based restoration requested and does not repair SSH key permissions. A private key should remain with its owner, not be copied onto the server.

Question 15

New Single answer

Topic: Manage security

Skill tested: Set SELinux enforcing persistently and restore policy-defined contexts after file relocation.

A RHEL application host was temporarily switched to SELinux permissive mode during troubleshooting. The issue is resolved, and the security baseline requires enforcing mode both immediately and after reboot. An administrator also moved a service directory back to its standard path, but its files still carry incorrect SELinux labels. Which action set is most appropriate?

Correct Answer: C. Run `setenforce 1`, set `SELINUX=enforcing` in `/etc/selinux/config`, and run `restorecon -Rv` on the standard-path directory.
Explanation:

`setenforce 1` switches the running system to enforcing mode, while `SELINUX=enforcing` in `/etc/selinux/config` makes that state persistent across reboot. `restorecon -Rv` reapplies the policy's default contexts to the relocated directory tree. Editing only the configuration in C does not immediately change the current runtime mode and leaves the incorrect labels. Permissive mode and arbitrary `chcon` labels in B conflict with the baseline and may not survive relabeling. SELinux is not disabled through a standalone service unit as suggested in D.