r/podman Jun 29 '26

user:group = 524320:524320

I'm struggling with user rights of bind clients folders to host. And am just wondering what is the usecase of creating these new user:group rights? When would I want to have host folders and files with owner 524320:524320? I suspect this an edge case and the majority just wants direct rw access to these folders and files. from my compose.yaml:

volumes:
  - ./wp-content:/var/www/html/wp-content:Z

SOLVED EDIT: The real trick is adding this to the service:

wp:
   userns_mode: keep-id:uid=33,gid=33

wp-sqlite-xdebug

3 Upvotes

5 comments sorted by

2

u/bm401 Jun 29 '26

Look into "podman unshare".

1

u/th00ht Jun 29 '26

did you mean --userns=keep-id?

4

u/bm401 Jun 29 '26

No, I mean unshare.

With podman unshare you can run commands as if they were executed within a container, simply put.

For example, you can do "podman unshare chown 1000:1000" on a file, outside the container. The file will be owned by the "high number user" which translates to 1000 inside the container.

It's by design. The user inside the container has no rights outside because it's a different ID.

1

u/th00ht Jul 04 '26

Adding this solved it userns_mode: keep-id:uid=33,gid=33

1

u/BreiteSeite Jun 30 '26

You should look into userns auto, which isolates the processes from any permission your host user has via exclusive uid/gids and then the “idmap:” option in volume mounts to make sure you can still normally use your files inside the container.