@@ -19,12 +19,13 @@ configuration; simply use the various `lxc-*` commands, such as
1919
2020### Creating unprivileged containers
2121
22- The normal ranges of user IDs (UIDs) and group IDs (GIDs) are from 0 to 65535.
22+ User IDs (UIDs) and group IDs (GIDs) normally range from 0 to 65535.
2323Unprivileged containers enhance security by mapping UID and GID ranges inside
24- each container to ranges not in use by the host system. The host ranges must be
25- * subordinated* to the user who will be running the unprivileged containers.
24+ each container to ranges not in use by the host system. The unused host ranges
25+ must be * subordinated* to the user who will be running the unprivileged
26+ containers.
2627
27- Subordinate UIDs and GIDs are assigned by the
28+ Subordinate UIDs and GIDs are assigned in the
2829[ subuid(5)] ( https://man.voidlinux.org/subuid.5 ) and
2930[ subgid(5)] ( https://man.voidlinux.org/subgid.5 ) files, respectively.
3031
@@ -42,18 +43,20 @@ In each colon-delimited entry:
4243- the second field is the smallest numeric ID defining a subordinate range; and
4344- the third field is the number of consecutive IDs in the range.
4445
46+ The [ usermod(8)] ( https://man.voidlinux.org/usermod.8 ) program may also be used
47+ to manipulate suborinated IDs.
48+
4549Generally, the number of consecutive IDs should be an integer multiple of 65536;
4650the starting value is not important, except to ensure that the various ranges
4751defined in the file do not overlap. In this example, ` root ` controls UIDs (or,
4852from ` subgid ` , GIDs) ranging from 1000000 to 1065535, inclusive; ` user ` controls
4953IDs ranging from 2000000 to 2065535.
5054
5155Before creating a container, the user owning the container will need an
52- [ lxc.conf(5)] ( https://man.voidlinux.org/lxc.conf.5 ) file, ` default.conf ` ,
53- specifying the subuid and subgid range to use. For root-owned containers, this
54- file resides at ` /etc/lxc/default.conf ` ; for unprivileged users, the file
55- resides at ` ~/.config/lxc/default.conf ` . Mappings are described in lines of the
56- form
56+ [ lxc.conf(5)] ( https://man.voidlinux.org/lxc.conf.5 ) file specifying the subuid
57+ and subgid range to use. For root-owned containers, this file resides at
58+ ` /etc/lxc/default.conf ` ; for unprivileged users, the file resides at
59+ ` ~/.config/lxc/default.conf ` . Mappings are described in lines of the form
5760
5861```
5962lxc.idmap = u 0 1000000 65536
@@ -68,7 +71,7 @@ seen from outside the container*, and may be an arbitrary value within the range
6871delegated in ` /etc/subuid ` or ` /etc/subgid ` . The final value is the number of
6972consecutive IDs to map.
7073
71- ** Note: ** Although the external range start is arbitrary, care must be taken to
74+ Note that, although the external range start is arbitrary, care must be taken to
7275ensure that the end of the range implied by the start and number does not extend
7376beyond the range of IDs delegated to the user.
7477
@@ -97,9 +100,11 @@ containers.
97100By default, configurations and mountpoints for system containers are stored in
98101` /var/lib/lxc ` , while configurations for user containers and mountpoints are
99102stored in ` ~/.local/share/lxc ` . Both of these values can be modified by setting
100- ` lxc.lxcpath ` in the relevant ` default.conf ` . The superuser may launch
101- unprivileged containers in the system ` lxc.lxcpath ` ; regular users may launch
102- unprivileged containers in their personal ` lxc.lxcpath ` .
103+ ` lxc.lxcpath ` in the
104+ [ lxc.system.conf(5)] ( https://man.voidlinux.org/lxc.system.conf.5 ) file. The
105+ superuser may launch unprivileged containers in the system ` lxc.lxcpath ` defined
106+ in ` /etc/lxc/lxc.conf ` ; regular users may launch unprivileged containers in the
107+ personal ` lxc.lxcpath ` defined in ` ~/.config/lxc/lxc.conf ` .
103108
104109All containers will share the same subordinate UID and GID maps by default. This
105110is permissible, but it means that an attacker who gains elevated access within
0 commit comments