Welcome to TestSimulate

Pass Your Next Certification Exam Fast!

Everything you need to prepare, learn & pass your certification exam easily.

365 days free updates. First attempt guaranteed success.

RedHat Red Hat Certified System Administrator - RHCSA (EX200) Free Practice Test

Question 1
Deny cron access for user john.
Correct Answer:
See the solution below in Explanation.
Explanation:
Solution:
echo "john" > > /etc/cron.deny
Detailed Explanation:
* cron.deny blocks listed users from using cron.
* This is the simplest way to deny scheduled-job access for one user.
Question 2
Add Swap Partition
Add an additional swap partition of 512 MiB to your system. The swap partition should be automatically mounted at system startup. Do not delete or modify any
existing swap partitions on the system.
Correct Answer:
Solution:
[root@node2 ~]# lsblk
[root@node2 ~]# fdisk /dev/vdb
Welcome to fdisk (util-linux 2.37.4).
Changes will remain in memory only, until you decide to write them.
Be careful before using the write command.
This disk is currently in use - repartitioning is probably a bad idea.
It's recommended to umount all file systems, and swapoff all swap
partitions on this disk.
Command (m for help): n
Partition number (3-128, default 3):
First sector (1476608-10485726, default 1476608):
Last sector, +/-sectors or +/-size{K,M,G,T,P} (1476608-10485726, default 10485726): +512M
Created a new partition 3 of type 'Linux filesystem' and of size 512 MiB.
Command (m for help): w
The partition table has been altered.
Syncing disks.
[root@node2 ~]# mkswap /dev/vdb3
[root@node2 ~]# vim /etc/fstab
/dev/vdb3 swap swap defaults 0 0
[root@node2 ~]# swapon -a
[root@node2 ~]# swapon
NAME TYPE SIZE USED PRIO
/dev/vdb2 partition 243M 0B -2
/dev/vdb3 partition 512M 0B -3
Question 3
Create a volume group with a physical extent size of 16 MB and create a logical volume using 30 extents.
Correct Answer:
See the solution below in Explanation.
Explanation:
Solution:
pvcreate /dev/sdb3
vgcreate -s 16M VG1 /dev/sdb3
lvcreate -l 30 -n LV1 VG1
mkfs.ext4 /dev/VG1/LV1
Detailed Explanation:
* vgcreate -s 16M sets PE size to 16 MB.
* lvcreate -l 30 allocates 30 extents.
* 30 x 16 MB = 480 MB total LV size.
* mkfs.ext4 creates the filesystem.
Question 4
Configure passwordless sudo access for members of the ops group to run only /usr/bin/systemctl restart httpd.
Correct Answer:
See the solution below in Explanation.
Explanation:
Solution:
groupadd ops
visudo -f /etc/sudoers.d/ops-restart-httpd
Add this line to the file:
%ops ALL=(ALL) NOPASSWD: /usr/bin/systemctl restart httpd
Set correct permissions:
chmod 440 /etc/sudoers.d/ops-restart-httpd
visudo -cf /etc/sudoers.d/ops-restart-httpd
Detailed Explanation:
* Using /etc/sudoers.d/ is the standard safe approach.
* visudo validates syntax and helps prevent syntax errors.
* %ops applies the rule to the whole group.
* Restricting the exact command is better than granting broad sudo access. Red Hat's RHEL 10 security
hardening guide documents sudo configuration through sudoers. ( Red Hat Documentation )
Question 5
Create a Container Image
As the user "wallah," download the Containerfile from http://classroom/Containerfile.
Do not modify the content of this file. Build an image named "pdf."
Correct Answer:
Solution:
# Install container management tools
[root@node1 ~]# dnf -y install container-tools
# Execute operations as the user wallah
[root@node1 ~]# ssh wallah@localhost
# Download the container build file
[wallah@node1 ~]# wget http://classroom/Containerfile
# Log in to the image registry
[wallah@node1 ~]# podman login -u admin -p redhat321 registry.lab.example.com
# Build the container image using the Containerfile in the current directory, with the image name "pdf"
[wallah@node1 ~]# podman build -t pdf .
# View the images
[wallah@node1 ~]$ podman images
REPOSITORY TAG IMAGE ID CREATED SIZE
localhost/pdf latest 1d6e7ea71460 31 seconds ago 300 MB
registry.lab.example.com/ubi9-beta/ubi latest 28b0a4b69d9b 2 years ago 229 MB
Question 6
Create a Quadlet-based systemd container unit so a UBI 10 container named sleepy starts automatically at boot.
Correct Answer:
See the solution below in Explanation.
Explanation:
Solution:
Create the Quadlet file:
mkdir -p /etc/containers/systemd
cat > /etc/containers/systemd/sleepy.container < < 'EOF'
[Container]
Image=registry.access.redhat.com/ubi10/ubi
ContainerName=sleepy
Exec=sleep 3600
[Install]
WantedBy=multi-user.target
EOF
Reload and enable:
systemctl daemon-reload
systemctl enable --now sleepy.service
systemctl status sleepy.service
Detailed Explanation:
* Quadlet is the preferred modern way to manage Podman containers with systemd for new configurations.
* The .container file is translated into a systemd-managed service.
* RHEL 10 documentation notes that podman generate systemd still exists, but Quadlets are preferred for new setups. ( Red Hat Documentation )
Question 7
Extend logical volume lvbackup by 500 MiB and grow the XFS filesystem online.
Correct Answer:
See the solution below in Explanation.
Explanation:
Solution:
lvextend -L +500M /dev/vgdata/lvbackup
xfs_growfs /backup
df -h /backup
Detailed Explanation:
* lvextend increases the LV size.
* xfs_growfs expands the XFS filesystem while mounted.
* This is a classic RHCSA storage task and aligns with RHEL 10 LVM/XFS workflows. ( Red Hat
Documentation )