Last active 2 hours ago

mag37 revised this gist 2 hours ago. Go to revision

1 file changed, 3 insertions, 3 deletions

Podman_tricks.md

@@ -1,13 +1,13 @@
1 1 ## Calculate new SUBUID range:
2 2 ```sh
3 3 PREVIOUS="$(sort -t: -k2 -n /etc/subuid | tail -n1)" && PREVIOUS="${PREVIOUS#*:}" && echo "$PREVIOUS"
4 - 165536:65536
4 + # ex.out: 165536:65536
5 5
6 6 FIRST="$((${PREVIOUS%:*}+${PREVIOUS#*:}))" && echo "$FIRST"
7 - 231072
7 + # ex.out: 231072
8 8
9 9 NEW=${FIRST}-$((${FIRST}+65535)) && echo "$NEW"
10 - 231072-296607
10 + # ex.out: 231072-296607
11 11 ```
12 12
13 13 Then use that range for the new podman user:

mag37 revised this gist 3 hours ago. Go to revision

1 file changed, 1 insertion, 1 deletion

Podman_tricks.md

@@ -11,7 +11,7 @@ NEW=${FIRST}-$((${FIRST}+65535)) && echo "$NEW"
11 11 ```
12 12
13 13 Then use that range for the new podman user:
14 - ```
14 + ```sh
15 15 sudo usermod --add-subuids 231072-296607 --add-subgids 231072-296607 USERNAME
16 16 ```
17 17

mag37 revised this gist 3 hours ago. Go to revision

1 file changed, 20 insertions

Podman_tricks.md(file created)

@@ -0,0 +1,20 @@
1 + ## Calculate new SUBUID range:
2 + ```sh
3 + PREVIOUS="$(sort -t: -k2 -n /etc/subuid | tail -n1)" && PREVIOUS="${PREVIOUS#*:}" && echo "$PREVIOUS"
4 + 165536:65536
5 +
6 + FIRST="$((${PREVIOUS%:*}+${PREVIOUS#*:}))" && echo "$FIRST"
7 + 231072
8 +
9 + NEW=${FIRST}-$((${FIRST}+65535)) && echo "$NEW"
10 + 231072-296607
11 + ```
12 +
13 + Then use that range for the new podman user:
14 + ```
15 + sudo usermod --add-subuids 231072-296607 --add-subgids 231072-296607 USERNAME
16 + ```
17 +
18 + Propagate changes: `podman system migrate`
19 + And validate as the new user: `podman unshare cat /proc/self/uid_map`
20 +
Newer Older