Skip to main content

Why is container root not equivalent to host root when user namespaces are enabled?

Expert Docker
Quick Answer With user namespaces enabled, container UID 0 (root) maps to an unprivileged UID on the host (e.g., 100000). Inside the container, a process has full root capabilities within the namespace. But on the host, it's just a regular unprivileged user. Files created by "container root" are owned by UID 100000 on the host รขโ‚ฌโ€ not actual root.

Answer

User namespaces remap UID 0 inside container to an unprivileged UID on host, preventing host-level root access.
S
SugharaIQ Editorial Team Verified Answer

This answer has been peer-reviewed by industry experts holding senior engineering roles to ensure technical accuracy and relevance for modern interview standards.

Want to bookmark, take notes, or join discussions?

Sign in to access all features and personalize your learning experience.

Sign In Create Account

Source: SugharaIQ

Ready to level up? Start Practice