1 year ago
#377373
PascalTurbo
Can not access folder after chown with podman unshare
I have a rootless setup (podman is running in user space and the container I'm starting is also rootless. Now I wan't to mount a volume. To do so I'm using podman unshare chown
but after executing this, I can not access the folder anymore
The initial permissions:
$ ls -lan
drwxrwxr-x. 2 1000 1000 19 5. Apr 14:02 postgresql-application
drwxrwxr-x. 2 1000 1000 19 5. Apr 13:52 postgresql-keycloak
Setting permissions with unshare for my containers:
$podman unshare chown -R 1001:1001 postgresql-application
$ podman unshare ls -lan
drwxrwxr-x. 2 1001 1001 19 5. Apr 14:02 postgresql-application
drwxrwxr-x. 2 0 0 19 5. Apr 13:52 postgresql-keycloak
Permissions form my users perspective
$ ls -lan
drwxrwxr-x. 2 101000 101000 19 5. Apr 14:02 postgresql-application
drwxrwxr-x. 2 1000 1000 19 5. Apr 13:52 postgresql-keycloak
No access to my folder anymore
$ touch postgresql-application/test
touch: 'postgresql-application/test' kann nicht berührt werden: Keine Berechtigung
Although I can not access the folder mounted to a container because podman is running as my user and is also not able to access the folder
$ podman run -it -v ./postgresql-application/:/bitnami/postgresql/:Z docker.io/bitnami/postgresql:12 ls -lan /bitnami && ls -lan /bitnami/postgresql
total 0
drwxr-xr-x. 3 0 0 24 Apr 5 04:59 .
dr-xr-xr-x. 1 0 0 65 Apr 5 12:16 ..
drwxrwxr-x. 2 1001 1001 19 Apr 5 12:02 postgresql
ls: Zugriff auf '/bitnami/postgresql' nicht möglich: Datei oder Verzeichnis nicht gefunden
permissions
selinux
chown
podman
unshare
0 Answers
Your Answer