Red Hat Certified System Administrator RHCSA · Free Practice Question Hard

Question 22

On rhel.server.com, as a system administrator on a RHEL 9 system, you are tasked with deploying a static website using Podman in rootless mode. Create a rootless Podman container as user john (create if not already existing) that meets the following requirements:

  • Uses a publicly available, lightweight nginx image.

  • Exposes port 8080 on the host to serve the website.

  • Mounts /var/www/html on the host as /usr/share/nginx/html inside the container.

  • Is managed by systemd for persistence and auto-start.

  • Has correct SELinux context for the mounted directory.

Note: You can pull the nginx image from any of the following repositories:

  • registry.access.redhat.com/nginx:latest

  • registry.redhat.io/nginx:latest

  • docker.io/library/nginx:latest

  • A

    Pass

  • B

    Fail

Reveal correct answer

Correct answer: A

Explanation

Answer (Two Methods)

Step 1: Create the User john (if not existing)

Step 2: Enable Session Persistence for john

Step 3: Prepare the Host Directory

Method 1: Using Deprecated podman generate systemd

Step 4A: Run the Container Manually (Rootless)

Switch to user john:

Step 5A: Generate and Enable systemd Service

Note: The podman generate systemd command is deprecated. It will receive only critical bug fixes, with no new features. For long-term use, the Quadlet method below is recommended.

Method 2: Recommended — Using Quadlet (Declarative Approach)

Step 4B: Create Quadlet Configuration

Switch to user john:

File Content:

Step 5B: Enable Quadlet Service

Verification

Test website deployment:

Summary

  • The deprecated method using podman generate systemd is functional but no longer enhanced.

  • The Quadlet method is the preferred, future-proof solution, offering a declarative and maintainable setup similar to Kubernetes or Compose.

Discussion

Think the marked answer is wrong, or have a better explanation? Share it below — comments appear after review.

You must be logged in to post a comment.

Preparing For

Your Certification?

255+ certifications
Detailed explanations
Free PDF samples

Has All The Questions You Need