-
Notifications
You must be signed in to change notification settings - Fork 2.4k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Podman is not compatible with user management inside container (i.e. with libnss-extrausers) #11805
Comments
I don't think we want to touch the defaults here. Would a new flag to disable alterations to |
Yes, flag to disallow podman touching existing /etc/passwd and /etc/groups in container will resolve (1). What about same flag being more general (i.e. |
That could have other effects - we need those checks to ensure your user in the container has the appropriate groups added. |
Ok. Flag to disable alterations to /etc/passwd and /etc/groups will resolve more important problem (1). Thank you. |
I am not sure how this is supposed to work. Podman needs to know the UID and GID before the container starts because it needs to set it in the OCI runtime configuration that expects two uint32 (https://github.com/opencontainers/runtime-spec/blob/master/schema/defs.json#L57-L62). One suggestion, you could try to add the users with a prestart hook, and see if that would work. |
You quoted (2) - this was dropped already above.
Resolution for problem (1): when new flag (i.e.
Seems overcomplicated for such simple thing + not sure if hooks are able to modify /etc/passwd when Consider adding such flag for compatibility with docker. |
I'll reopen for the flag - maybe |
|
After rethinking: package for passwd/groups is also called https://packages.debian.org/bullseye/passwd so |
One more idea: when podman adds passwd entry, it hardocodes some stuff like home, comment, shell, username (=uid), groupname(=gid); would be better not only to allow to disable touching /etc/passwd and /etc/group but also allow admin to fine tune these entries it required; consider adding new parameter to
|
A friendly reminder that this issue had no activity for 30 days. |
A friendly reminder that this issue had no activity for 30 days. |
@cdoern PTAL |
actively working on this. |
added support for a new flag --passwd which, when false prohibits podman from creating entries in /etc/passwd and /etc/groups allowing users to modify those files in the container entrypoint resolves containers#11805 Signed-off-by: cdoern <[email protected]>
Is this a BUG REPORT or FEATURE REQUEST? (leave only one on its own line)
/kind bug
Description
(1)
One cannot force
podman run --user=1234:1234
to avoid touching '/etc/passwd' when one uses own logic like extrausers...https://packages.debian.org/bullseye/libnss-extrausers
...to create entry for UID 1234 in container entrypoint. Extrausers allows username to be resolved in container.
podman run
should have option (maybe--no-userdb-changes
to disable touching user/group db in container if admin prefers such solution.(2)
If one try to run
podman run --user usertest:usertest
without usertest present in /etc/passwd in container - podman will throwError: unable to find user usertest: no matching entries in passwd file
error even if such user will be created by container itself (i.e. using extrausers).podman run
should have option (maybe--no-userdb-checks
to disable checking for user/group existence in container if admin prefers such solution.Output of
podman version
:Output of
podman info --debug
:Package info (e.g. output of
rpm -q podman
orapt list podman
):Have you tested with the latest version of Podman and have you checked the Podman Troubleshooting Guide? (https://github.com/containers/podman/blob/master/troubleshooting.md)
No
Additional environment details (AWS, VirtualBox, physical, etc.):
The text was updated successfully, but these errors were encountered: