-
Notifications
You must be signed in to change notification settings - Fork 221
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
sudo(8) inside toolbox containers asks for a password with Podman 2.0.5 #523
Comments
I did some testing on Fedora Workstation 32 and Fedora Workstation 33 (on virtual machines) and I can confirm that on F32 was working fine, but on F33 I got the same issue. After some testing I noticed some differences:
At the toolbox container in Fedora 33 the user doesn't have its own group and it's not at the group The diff for the --- f32-image-f33/group 2020-08-14 19:19:38.734363987 +0000
+++ f33-image-f33/group 2020-08-14 19:17:39.018504713 +0000
@@ -8,7 +8,7 @@
lp:x:7:
mem:x:8:
kmem:x:9:
-wheel:x:10:vagrant
+wheel:x:10:
cdrom:x:11:
mail:x:12:
man:x:15:
@@ -26,4 +26,3 @@
utempter:x:35:
ssh_keys:x:999:
tcpdump:x:72:
-vagrant:x:1000: The diff for the --- f32-image-f33/shadow 2020-08-14 19:15:25.125242112 +0000
+++ f33-image-f33/shadow 2020-08-14 19:17:11.658920405 +0000
@@ -1,4 +1,4 @@
-root::18488:0:99999:7:::
+root:!locked::0:99999:7:::
bin:*:18473:0:99999:7:::
daemon:*:18473:0:99999:7:::
adm:*:18473:0:99999:7:::
@@ -12,4 +12,3 @@
ftp:*:18473:0:99999:7:::
nobody:*:18473:0:99999:7:::
tcpdump:!!:18481::::::
-vagrant::18488:0:99999:7::: |
The problem is still present in rawhide (F33SB) with the exception of the message on entering toolbox (/usr/bin/id: cannot find name for group ID 1000) is no longer popping up. |
I confirm that I too saw error (/usr/bin/id: cannot find name for group ID 1000) so i removed fedora-toolbox-33 image and re-created toolbox but now I cannot use |
I follow up with the findings I did the other day and I manage to get the Steps:(All this in a Fedora Workstation 33 in a VM)
It fails! 😞
Now it works! 😄 ConclusionSomething seems to go wrong at the user generation, at the |
Thank you for reporting this and trying to find the culprit! It seems that Podman in Rawhide changed the way it handles the The other part (having to type password for sudo) is caused by the fact that the code path pointed out by @juanje is only triggered if the current user is not present in the container. That code takes care of creating the user, adding it to the correct groups and deleting passwords for the user and root. I think the code in the |
Seems like it's not actually creating the group. Otherwise you'd have a name. It's just creating the user. I wonder if it's also creating a home directory. I hope not. |
containers/podman#6829 was the offending Podman change. |
This is happening for me now on Silverblue 32 using fedora-toolbox:f32 image |
Yeah, I have the issue on Silverblue 32 now on any new toolbox instance of F32. With old toolbox instance, it still works, but not with new creations. So, whatever was done to "fix" it, broke it on F32. |
Can confirm this issue on Fedora 32 SB with toolbox 0.0.93 and podman 2.0.5. |
This is not related or confined to Fedora only, Arch with toolbox 0.0.94 and podman 2.0.5 has the same problem. |
Since Podman 2.0.5, containers that were created with 'podman create --userns=keep-id ...' automatically get the user added to /etc/passwd [1]. However, this user isn't as fully configured as it needs to be. The home directory is specified as "/" and the shell is /bin/sh. Therefore, the entry point needs to call usermod(8) to update the user, instead of using useradd(8) to create it. [1] Podman commit 6c6670f12a3e6b91 containers/podman#6829 containers#523
Since Podman 2.0.5, containers that were created with 'podman create --userns=keep-id ...' automatically get the user added to /etc/passwd [1]. However, this user isn't as fully configured as it needs to be. The home directory is specified as '/' and the shell is /bin/sh. Note that Podman doesn't add the user's login group to /etc/group [2]. This leads to the following error when entering the container: /usr/bin/id: cannot find name for group ID 1000 It's expected that this will be fixed in Podman itself. Therefore, the entry point needs to call usermod(8) to update the user, instead of using useradd(8) to create it. [1] Podman commit 6c6670f12a3e6b91 containers/podman#6829 [2] containers/podman#7389 containers#523
Since Podman 2.0.5, containers that were created with 'podman create --userns=keep-id ...' automatically get the user added to /etc/passwd [1]. However, this user isn't as fully configured as it needs to be. The home directory is specified as '/' and the shell is /bin/sh. Note that Podman doesn't add the user's login group to /etc/group [2]. This leads to the following error when entering the container: /usr/bin/id: cannot find name for group ID 1000 It's expected that this will be fixed in Podman itself. Therefore, the entry point needs to call usermod(8) to update the user, instead of using useradd(8) to create it. [1] Podman commit 6c6670f12a3e6b91 containers/podman#6829 [2] containers/podman#7389 containers#523
That's because Podman 2.0.5 slipped into Fedora 32. |
This will make the subsequent commit easier to read. containers#523
Since Podman 2.0.5, containers that were created with 'podman create --userns=keep-id ...' automatically get the user added to /etc/passwd [1]. However, this user isn't as fully configured as it needs to be. The home directory is specified as '/' and the shell is /bin/sh. Note that Podman doesn't add the user's login group to /etc/group [2]. This leads to the following error when entering the container: /usr/bin/id: cannot find name for group ID 1000 It's expected that this will be fixed in Podman itself. Therefore, the entry point needs to call usermod(8) to update the user, instead of using useradd(8) to create it. [1] Podman commit 6c6670f12a3e6b91 containers/podman#6829 [2] containers/podman#7389 containers#523
Is it possible to add some tests for podman or toolbox to catch regressions like this? Silverblue really encourages one to use Toolbox, and for that to happen Toolbox needs to be as reliable as gnome-terminal itself. |
It has proven to be a surprisingly uphill battle to get the Podman team to care about backwards compatibility or to check if some change breaks Toolbox or not. @HarryMichal is consistently chasing down breakages and pushing for tests, but progress is slow. |
Since Podman 2.0.5, containers that were created with 'podman create --userns=keep-id ...' automatically get the user added to /etc/passwd [1]. However, this user isn't as fully configured as it needs to be. The home directory is specified as '/' and the shell is /bin/sh. Note that Podman doesn't add the user's login group to /etc/group [2]. This leads to the following error message when entering the container: /usr/bin/id: cannot find name for group ID 1000 It's expected that this will be fixed in Podman itself. Therefore, the entry point needs to call usermod(8) to update the user, instead of using useradd(8) to create it. [1] Podman commit 6c6670f12a3e6b91 containers/podman#6829 [2] containers/podman#7389 containers#523
I guess one way to avoid this problem is for Silverblue to have a separate rpm repo for podman and only alllow updates that are passing regression tests against toolbox |
When is it supposed to get to f32 updates? |
The sooner it reach to 3 positive karma :) You can track it yourself -> https://bodhi.fedoraproject.org/updates/FEDORA-2020-306addaac0 |
This karma system is new to me, how does it work? |
You will need FAS id (Fedora account id) to login to bodhi system and provide your vote on the updates. See https://fedoraproject.org/wiki/Bodhi#Karma |
On SilverBlue, can I pull only given package and test it? It seems it needs to be rebased to test a package. Any method of testing the package(including containers, if possible) without needing to touch my base system is fine. |
Unfortunately, you can't test things like Podman and Toolbox inside a container. |
Thanks so much for the workaround @juanje
The only change I made for my user on a Silverblue host was making the home directory |
Should this be reopened? Definitively still happening with 0.0.95. |
Have recorded the same experience in #549 (comment) -- commented there as this doesn't (usually) break sudo. |
What's still happening? You mean you are seeing this error when entering a container:
That's containers/podman#7389 I shied away from adding a similar workaround to Toolbox itself because it wouldn't correctly factor in things like Or did I misunderstand? |
@debarshiray : Thanks for the podman issue pointer! That looks like the root cause indeed. In the meantime, there workaround above is easy enough. |
When using toolbox on F33 Silverblue rawhide, entering a newly created toolbox results in an error as follows ...
Inside of toolbox, when issuing a command sudoer privileges are required for, such as dnf like so ...
sudo dnf install vim-enhanced terminator results in the following prompt to the user ...
then, if I enter the user password the result is password attempt failure ...
This issue was originally reported at https://discussion.fedoraproject.org/t/toolbox-and-root/22123/29 and I originally thought the users system must be broken in some way. That was until I installed a fresh rawhide version of Silverblue.
IMO, it may relate to the first message I get when entering the toolbox container. Perhaps not mapping the user as the root of the container.
The text was updated successfully, but these errors were encountered: