-
Notifications
You must be signed in to change notification settings - Fork 610
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
Changes to group membership are not reflected for current boot #528
Comments
You need to kill the ssh socket, since it keeps the previous session alive. anders@lima-default:/home/anders$ sudo usermod anders -g games
anders@lima-default:/home/anders$ sudo usermod -aG video anders
anders@lima-default:/home/anders$ id
uid=1000(anders) gid=1000(anders) groups=1000(anders)
anders@lima-default:/home/anders$ exit
logout
anders@ubuntu:~$ lima
anders@lima-default:/home/anders$ id
uid=1000(anders) gid=1000(anders) groups=1000(anders)
anders@lima-default:/home/anders$ exit
logout
anders@ubuntu:~$ rm ~/.lima/default/ssh.sock
anders@ubuntu:~$ lima
anders@lima-default:/home/anders$ id
uid=1000(anders) gid=60(games) groups=60(games),44(video)
anders@lima-default:/home/anders$ exit
logout By default, lima will keep the mux (ssh.sock) alive for 5 minutes (after logout). https://en.wikibooks.org/wiki/OpenSSH/Cookbook/Multiplexing SSH_CONFIG(5)
|
Nice, works perfectly. Thank you! |
This might need to be documented, it also affected important stuff like the prompt color :-) There is also |
So if I start a new Lima machine, change the primary group of the lima user, delete the ssh.sock file, and then run a container that mounts a local directory -- I get this error on the next reboot of the Lima machine when trying to start the container.
So it looks like I still need to reboot the Lima machine after changing the primary group of the default lima user. The logic would go something like this: |
Deleting the socket file might have been a bit brutal... There is also an "exit" option, might have been better ? |
I can try it...how does the "exit" option work? |
Afaict, it should terminate the master more gracefully. But I don't know how it will affect the sshfs, and it probably doesn't help with the primary group issues described either ? |
I'm just digging a bit deeper into how lima works. https://github.com/lima-vm/lima/blob/master/pkg/cidata/cidata.TEMPLATE.d/boot/ I've already sorted a better way to terminate a session, and that's with That's definitely less brutal than manually removing the |
Yes, that's what Note that in general the user name is not |
/> Note that in general the user name is not lima In any case I'm going to leave Lima and go back to I tried out Thanks for that! Going to try that now.... |
Note that you need to patch qemu, for "virtfs" to be available on Darwin.
But you could use |
I tried to use the approach of using I'm trying to configure rootful docker (rootless has some issues for what I'm trying to do) and basically the only way I can get |
@chancez Can't you instead change the permissions on the socket to make it world-read-writable? |
@jandubois I can give it a shot. Based on my reading of issues however, the provision scripts run after the ssh tunnel, so the socket perms would be updated too late. |
I'm afraid you may be right on this. :( |
Well, that worked, surprisingly. I bet SSH doesn't open the socket until the first attempt to use it, so the permissions are correct by that point. A snippet of the relevant provision script:
|
So if this is how it works, then I don't understand why lima/pkg/cidata/cidata.TEMPLATE.d/boot/07-etc-environment.sh Lines 16 to 18 in 001d8d0
|
If I change my group membership within a lima vm, I don't see those changes reflected immediately ie
Of course I've tried logging out and back in again, but to no avail. Rebooting the lima vm works.
newgrp
works as well, but I don't like the fact that it opens a new shell.Is there a way for the lima (or default) user to see their updated group membership list without resorting to rebooting the VM or by using
newgrp
?I need to do this as my primary gid on macos is 20 (and not 1000 as per the lima vm default)
I need the primary gids to match between macos and lima (it's a long story but it involves accessing mounted host volumes from within a container). It would just be extremely convenient if I didn't have to reboot the lima vm in order to do that.
The text was updated successfully, but these errors were encountered: