-
Notifications
You must be signed in to change notification settings - Fork 18.7k
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
userns remapping fails on externally authenticated Linux host... #20191
Comments
|
Thanks for the report--not sure we had thought about using On a separate note, given one of the reasons we are looking up the user is for the next step: reading the |
I was unaware of the need for those additional files... Is there any documentation which explains how they are used? |
Yes: https://docs.docker.com/engine/reference/commandline/daemon/#daemon-user-namespace-options I can point to a longer discussion where we were convinced by the main author/maintainer of user namespaces in the Linux kernel that this is the right model to use, as this is the accepted way for Linux distros to manage uid/gid map allocation. The format is simple enough that an administrator can create them by hand if necessary, if your distro tooling doesn't support auto-generation, or user creation wasn't performed on the system itself. |
NVM, I found it in the man pages... You are right. Currently, pam_cifs does not populate those files with samba user information. I will see if I can submit a patch to allow for that on the PAM project. |
👍 Thanks @InfoSec812 |
I ran into this issue the other day trying to setup a user that is provided by SSSD. @estesp, My current work around for a user that is provided by SSSD is to add the user as local user first with matching gid/uid in LDAP, and then start SSSD. It would be great if Docker actually tried the other resolvers provided by nsswitch. |
@digi691 one of the issues with Docker actually using glibc-based nsswitch capabilities is that this breaks the ability to statically link Go binaries; well more clearly, it requires some caution as you can see from that thread of discussion in a golang issue. Of course, distro versions of Docker tend to be dynamically linked now, as opposed to earlier releases that were almost always statically linked. Because of the above issues, libcontainer implemented it's own user/group lookup using direct parsing of the Maybe that can be revisited given the comment about most deliveries being dynamically linked now, but I think a more complete review of all the various binaries and how they are delivered would have to be done before switching to the glibc-based calls to query user/group info, which would honor nsswitch settings. |
@estesp But as commented earlier in this thread, docker could just call the |
Reasonable thought--for some reason I had glossed over that as referring to an API call, not |
ping @estesp were you still working on this? |
@thaJeztah yes, on my list. Let me see if I can get a WIP PR/branch together as I will need some user testing as I don't have a setup with external LDAP or other externally provided user/group database. |
I have attempted to solve this via PR #27599. I do not have a system capable of testing this, although I have been able to test that the calls to Is anyone on this issue stream able to test this PR and validate? That would be awesome! |
So in testing this recently I ended up having to put the specific UID returned by |
My laptop uses samba/winbind authentication, so there is no
passwd
entry on my machine for my user. This would be similarly true on an LDAP or NIS authenticated machine. When I try to use--userns-remap=<myuser>:<mygroup>
, I get the following error:I would propose that you should use
getent passwd
andgetent group
instead as it would supply details for user accounts which may not be local.The text was updated successfully, but these errors were encountered: