![]() |
![]()
| ![]() |
![]()
NAMEpodman-unshare - Run a command inside of a modified user namespace SYNOPSISpodman unshare [options] [command] DESCRIPTIONLaunches a process (by default, $SHELL) in a new user namespace. The user namespace is configured so that the invoking user's UID and primary GID appear to be UID 0 and GID 0, respectively. Any ranges which match that user and group in /etc/subuid and /etc/subgid are also mapped in as themselves with the help of the newuidmap(1) and newgidmap(1) helpers. podman unshare is useful for troubleshooting unprivileged operations and for manually clearing storage and other data related to images and containers. It is also useful to use the podman mount command. If an unprivileged user wants to mount and work with a container, then they need to execute podman unshare. Executing podman mount fails for unprivileged users unless the user is running inside a podman unshare session. The unshare session defines two environment variables:
IMPORTANT: This command is not available with the remote Podman client. OPTIONS--help, -hPrint usage statement --rootless-netnsJoin the rootless network namespace used for netavark networking. It can be used to connect to a rootless container via IP address (bridge networking). This is otherwise not possible from the host network namespace. Exit CodesThe exit code from podman unshare gives information about why the container failed to run or why it exited. When podman unshare commands exit with a non-zero code, the exit codes follow the chroot standard, see below: 125 The error is with podman itself $ podman unshare --foo; echo $? Error: unknown flag: --foo 125 126 Executing a contained command and the command cannot be invoked $ podman unshare /etc; echo $? Error: fork/exec /etc: permission denied 126 127 Executing a contained command and the command cannot be found $ podman unshare foo; echo $? Error: fork/exec /usr/bin/bogus: no such file or directory 127 Exit code contained command exit code $ podman unshare /bin/sh -c 'exit 3'; echo $? 3 EXAMPLEExecute specified command in rootless user namespace: $ podman unshare id uid=0(root) gid=0(root) groups=0(root),65534(nobody) Show user namespace mappings for rootless containers: $ podman unshare cat /proc/self/uid_map /proc/self/gid_map Show rootless netns information in user namespace for rootless containers: $ podman unshare --rootless-netns ip addr 1: lo: <LOOPBACK,UP,LOWER_UP> mtu 65536 qdisc noqueue state UNKNOWN group default qlen 1000 SEE ALSOpodman(1), podman-mount(1), namespaces(7), newuidmap(1), newgidmap(1), user_namespaces(7)
|