LOGBOOK

HELP

Quiz Entry - updated: 2026.11.10

What is a Linux user namespace, and how does it make a container's root user safer?

A namespace that maps user and group IDs so that UID 0 (root) inside the container is an ordinary, unprivileged high UID on the host — root in the container is not root on the host.

Namespaces isolate a process's view of system resources without the process being aware of it. The user namespace specifically remaps UIDs and GIDs across the container boundary.

Normally a process running as root (UID 0) inside a container is also UID 0 on the host — so a container escape lands the attacker as real root. With a user namespace enabled (userns-remap), the kernel maps the container's UID range onto a block of unprivileged host UIDs. For example, container UID 0 becomes host UID 231072, with the next 65536 IDs reserved for the container (recorded in /etc/subuid and /etc/subgid).

The payoff: if an attacker who is root inside the container breaks out, on the host they are a high, fictitious UID that is not even a real user and owns nothing — so they have no privileges on the host. It directly defeats the volume-mount and similar privilege-escalation tricks, because files the container "root" touches are owned by that harmless remapped UID.

Docker's --userns-remap=default creates the user dockremap automatically to anchor the mapping.

Go deeper:

From Quiz: ISLAB / Docker Security | Updated: Nov 10, 2026