You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
When the home directory has permission 700, running rootless podman with userns=keep-id causes a permission denied error.
When the home directory has permission 701, running rootless podman with userns=keep-id works fine.
When the home directory has permission 700, running rootless podman with userns=nomap silently changes the permission of my home directory to 711.
Steps to reproduce the issue
Everything is done under my user id, which does not have root privilege.
Now, I run the following on the host:
podman pull docker.io/library/debian:latest
chmod 700 ~
podman run -it --rm --userns=keep-id debian bash
I immediately get the following output:
Error: crun: make `/[redacted]/storage/overlay/4bbf7ee52463d3fc8f3b237c4334910c9b508c6ddb439e98f64740c14aad28b7/merged` private: Permission denied: OCI permission denied
Now, if I do the following on the host:
chmod 701 ~.
Run this again: podman run -it --rm --userns=keep-id debian bash
Everything works as expected. So it looks like userns=keep-id needs the home directory to have permission 701.
Now, let's do the following:
chmod 700 ~
podman run -it --rm --userns=nomap debian bash
Everything runs correctly, but if I run the following on the host:
stat -c %a ~
711
It looks like running podman with userns=nomap changes my home directory's permission to 711 silently.
Describe the results you received
When home directory has permission 700, running podman with userns=keep-id causes a permission denied error.
When home directory has permission 701, running podman with userns=keep-id works correctly.
When home directory has permission 700, running podman with userns=nomao works correctly but automatically changes the permission of my home directory to 711.
Describe the results you expected
I expect to be able to run rootless podman with userns=keep-id with home directory permission 700
I expect to be able to run rootless podman with userns=nomap without it silently changing my home directory permission to 711.
Additional information like issue happens only occasionally or issue happens with a particular architecture or on a particular setting
Update
On reflection, this may be the expected behavior. In the rootless mode with userns=keep-id, my host user id is mapped to a container user of the same uid. This means the container root user has to be mapped to some subuid on the host. In order for the container root to have access to the container files residing on the host, it will need at least directory traversal permission for every directory from "/" to the files, and this is why the 001 bit is set. I am unsure about the internal implementation., This is my deduction by logic. Is there a better/safer way to get my things set up? If not, you can close it.
The text was updated successfully, but these errors were encountered:
Issue Description
Steps to reproduce the issue
Everything is done under my user id, which does not have root privilege.
Now, I run the following on the host:
podman pull docker.io/library/debian:latest
chmod 700 ~
podman run -it --rm --userns=keep-id debian bash
I immediately get the following output:
Now, if I do the following on the host:
chmod 701 ~
.podman run -it --rm --userns=keep-id debian bash
Everything works as expected. So it looks like userns=keep-id needs the home directory to have permission 701.
Now, let's do the following:
chmod 700 ~
podman run -it --rm --userns=nomap debian bash
Everything runs correctly, but if I run the following on the host:
stat -c %a ~ 711
It looks like running podman with userns=nomap changes my home directory's permission to 711 silently.
Describe the results you received
Describe the results you expected
podman info output
Podman in a container
No
Privileged Or Rootless
Rootless
Upstream Latest Release
No
Additional environment details
Additional environment details
Additional information
Additional information like issue happens only occasionally or issue happens with a particular architecture or on a particular setting
Update
On reflection, this may be the expected behavior. In the rootless mode with userns=keep-id, my host user id is mapped to a container user of the same uid. This means the container root user has to be mapped to some subuid on the host. In order for the container root to have access to the container files residing on the host, it will need at least directory traversal permission for every directory from "/" to the files, and this is why the 001 bit is set. I am unsure about the internal implementation., This is my deduction by logic. Is there a better/safer way to get my things set up? If not, you can close it.
The text was updated successfully, but these errors were encountered: