Which container does a user ID belong to?

Hi,

When I look at all processes on the host, I see the user IDs on the host.
Is there an easy way to show the mapping between user IDs on the host and usernames in containers?

Thanks

No. Usernames are a userspace construct, the kernel has no idea what a username is.

As a result, how an id is converted to a name entirely depends on the userspace that’s being run and can vary from distribution to distribution and can get very complex with a variety of plugins and even network name resolution.

So it seems to be only possible to pinpoint a user in isolated containers using volatile.idmap.current.
Correct?
But there is no summary function for this yet?

You can look at the volatile keys to figure out the map which would tell you what uid something is in the container, but your post asked about username and that part you won’t get.

1 Like