You are preparing to start two containers with Podman on a RHEL server where SELinux is in enforcing mode. Both containers must read from and write to the same host directory /srv/data, which should be mounted at /data inside each container. You want SELinux to relabel the directory automatically so that it can be shared among multiple containers without disabling confinement. Which volume-mount option accomplishes this requirement?
Append :Z to the -v argument (for example, -v /srv/data:/data:Z)
Append :z to the -v argument (for example, -v /srv/data:/data:z)
Use no additional option; SELinux automatically permits shared bind mounts
Append :shared to the -v argument (for example, -v /srv/data:/data:shared)
The :z suffix on a bind-mount or -v option tells the container engine to relabel the host path with the shared container_file_t type and no unique MCS category. Any container that mounts the same path with :z will then have SELinux permission to access it, satisfying the requirement that multiple containers share the directory. The :Z suffix applies a private, unique MCS label that prevents other containers from using the directory. The :shared flag relates to mount-propagation, not SELinux contexts, and leaving the mount unlabeled typically causes SELinux to deny access when the second container tries to use the directory.
Ask Bash
Bash is our AI bot, trained to help you pass your exam. AI Generated Content may display inaccurate information, always double-check anything important.
What does the :z option do in Podman with SELinux enforcing mode?
Open an interactive chat with Bash
How does the :Z option differ from :z in Podman volume mounts?
Open an interactive chat with Bash
What is the purpose of SELinux in container environments like RHEL with Podman?
Open an interactive chat with Bash
CompTIA Linux+ XK0-006 (V8)
Services and User Management
Your Score:
Report Issue
Bash, the Crucial Exams Chat Bot
AI Bot
Loading...
Loading...
Loading...
Pass with Confidence.
IT & Cybersecurity Package
You have hit the limits of our free tier, become a Premium Member today for unlimited access.
Military, Healthcare worker, Gov. employee or Teacher? See if you qualify for a Community Discount.
Monthly
$19.99
$19.99/mo
Billed monthly, Cancel any time.
3 Month Pass
$44.99
$14.99/mo
One time purchase of $44.99, Does not auto-renew.
MOST POPULAR
Annual Pass
$119.99
$9.99/mo
One time purchase of $119.99, Does not auto-renew.
BEST DEAL
Lifetime Pass
$189.99
One time purchase, Good for life.
What You Get
All IT & Cybersecurity Package plans include the following perks and exams .