user namespace
The namespace that can map the root user inside a container to an unprivileged user on the host.
In more detail
Without a user namespace, root inside a container is the same user ID 0 as root on the host, only restricted by other features. With user namespace remapping, container root becomes an ordinary high-numbered user outside, so an escape lands with no special rights. Docker does not turn this on by default; rootless mode and userns-remap are the two ways to get it.
Related terms
- namespace (Linux) — A Linux kernel feature that controls what a process can see, such as which other processes, network or host name.
- root user — The all-powerful administrator account on Linux, with user ID 0, which can read or change anything.
- rootless mode — Running the Docker daemon and containers as an ordinary user instead of root.
- UID and GID — The numbers Linux uses to identify a user (UID) and a group (GID); root is UID 0.
Taught in
- Container Hardening: Distroless & Rootless — Cloud Security & DevSecOps Engineering
- Namespaces And Cgroups: Isolation And Limits — Docker Architecture & Production Containers
- Minimal Bases, Non Root Users And Smaller Images — Docker Architecture & Production Containers
- Bind Mounts, Permissions And Backups — Docker Architecture & Production Containers