Hi everyone! I’m a long time Docker user and have been considering moving to podman for a few months now. I’ve been trying to understand how podman handles user:group assignments for pods and what the userns option does exactly. So if anyone is willing to take the time to answer my questions I would be thankful.
From my reading it seems by default podman will “translate” the in container UID:GID to a subid of the user that ran the container. So even if inside the container it is root or whatever, on the host it will save files with the subid of my user. Correct? If so, does that mean if I have multiple containers ran by my user, all of which use root inside the container, all the files saved on the host will be owned by the same subid? Meaning an attacker breaking out from one container will protect the host but they would still have access to the files of the other container.
Assuming the above scenario is true, I would prefer to assign each container to it’s own host user. For example nextcloud will have a nextcloud user on the host and the container will use the subids of the nextcloud user. Is that possible? Searching around I could not find an answer to this question outside of logging into the host with that user and running the container as that user. Which would be annoying with many containers. And the userns mode setting seems to only change how the IDs are “translated” to the host, if at all. I could maybe set the keep-id mode and set the user inside the container but I’ve had some issues in the past on docker with trying to run containers as different users. So how do you do this? Do you have issues changing the user inside the container?

