vscode-remote-release icon indicating copy to clipboard operation
vscode-remote-release copied to clipboard

[Remote-SSH Bug]: New groups are not applied on the Remote-SSH session

Open maxballenger opened this issue 11 months ago • 4 comments

Is there an existing issue for this bug?

  • [X] I have searched the existing issues

Required Troubleshooting Steps

  • [X] I have followed these troubleshooting steps
  • [X] I have tried both values of the remote.SSH.useLocalServer setting

Connect Locally

It connects successfully

->

No response

Expected Behavior

  1. Add user to a new group on remote machine.
  2. User restarts the VSCode server on remote machine using RemoteSSH: Kill VSCode Server on Host.
  3. Reconnect to remote machine from VSCode
  4. User has permissions granted by new group

Steps To Reproduce

This is essentially a duplicate of #5813

  1. Create a temp folder and file owned by a group to which the current user does not belong
ballenger@system:~$ mkdir ./tmp
ballenger@system:~$ mkdir ./tmp/test
ballenger@system:~$ touch ./tmp/test/test
ballenger@system:~$ sudo find ./tmp -type d -exec chmod 0775 {} +
ballenger@system:~$ sudo find ./tmp -type f -exec chmod 0660 {} +
ballenger@system:~$ sudo chown -R 5000:5000 ./tmp/test
ballenger@system:~$ sudo find ./tmp/test -type d -exec chmod 0770 {} +
ballenger@system:~$ sudo find ./tmp/test -type f -exec chmod 0660 {} +
ballenger@system:~$ sudo groupadd --gid 5000 newTestGroup
  1. Add the current user to the group
ballenger@system:~$ sudo usermod -a -G newTestGroup ballenger
ballenger@system:~$ groups
ballenger sudo
ballenger@system:~$ groups ballenger
ballenger : ballenger sudo newTestGroup
ballenger@system:~$ id -Gn
ballenger sudo
ballenger@system:~$ newgrp newTestGroup
ballenger@system:~$ id -Gn
newTestGroup sudo ballenger
  1. Confirm that the user can access the folder
ballenger@system:~$ cd tmp
ballenger@system:~/tmp$ ls -l
total 4
drwxrwx--- 2 5000 newTestGroup 4096 Mar 27 14:12 test
ballenger@system:~/tmp$ cd ./test/
ballenger@system:~/tmp/test$ ls -l
total 0
-rw-rw---- 1 5000 newTestGroup 0 Mar 27 14:12 test
  1. Kill the VSCode server on the remote host using RemoteSSH: Kill VSCode Server on Host
  2. Check group membership again - user is not part of the group anymore and user cannot access the folder
ballenger@system:~$ id -Gn
ballenger sudo
ballenger@system:~$ cd tmp
ballenger@system:~/tmp$ ls
test
ballenger@system:~/tmp$ ls -l
total 4
drwxrwx--- 2 5000 newTestGroup 4096 Mar 27 14:12 test
ballenger@system:~/tmp$ cd test/
bash: cd: test/: Permission denied

Remote-SSH Log

Remote-SSH Log

[14:21:22.552] Log Level: 2
[14:21:22.558] VS Code version: 1.87.2
[14:21:22.559] Remote-SSH version: [email protected]
[14:21:22.559] linux x64
[14:21:22.559] SSH Resolver called for "ssh-remote+xx", attempt 1
[14:21:22.560] "remote.SSH.useLocalServer": true
[14:21:22.560] "remote.SSH.useExecServer": false
[14:21:22.560] "remote.SSH.path": undefined
[14:21:22.560] "remote.SSH.configFile": undefined
[14:21:22.560] "remote.SSH.useFlock": true
[14:21:22.560] "remote.SSH.lockfilesInTmp": false
[14:21:22.560] "remote.SSH.localServerDownload": auto
[14:21:22.560] "remote.SSH.remoteServerListenOnSocket": false
[14:21:22.560] "remote.SSH.showLoginTerminal": false
[14:21:22.560] "remote.SSH.defaultExtensions": []
[14:21:22.560] "remote.SSH.loglevel": 2
[14:21:22.560] "remote.SSH.enableDynamicForwarding": true
[14:21:22.560] "remote.SSH.enableRemoteCommand": false
[14:21:22.560] "remote.SSH.serverPickPortsFromRange": {}
[14:21:22.560] "remote.SSH.serverInstallPath": {}
[14:21:22.563] SSH Resolver called for host: xx
[14:21:22.563] Setting up SSH remote "xx"
[14:21:22.565] Acquiring local install lock: /tmp/vscode-remote-ssh-8b29e492-install.lock
[14:21:22.565] Looking for existing server data file at /home/ballenger/.config/Code/User/globalStorage/ms-vscode-remote.remote-ssh/vscode-ssh-host-8b29e492-863d2581ecda6849923a2118d93a088b0745d9d6-0.109.0-tr/data.json
[14:21:22.565] Using commit id "863d2581ecda6849923a2118d93a088b0745d9d6" and quality "stable" for server
[14:21:22.567] Install and start server if needed

Anything else?

No response

maxballenger avatar Mar 27 '24 18:03 maxballenger

any updates on this? How can I solve that problem?

Fabioni avatar May 07 '24 18:05 Fabioni

@Fabioni the workaround is here https://github.com/microsoft/vscode-remote-release/issues/5813#issuecomment-958770528

maxballenger avatar May 07 '24 19:05 maxballenger

And running the "Kill VS Code Server on Host" command doesn't do it? Is it leaving processes behind that you are killing manually?

roblourens avatar May 08 '24 18:05 roblourens

And running the "Kill VS Code Server on Host" command doesn't do it? Is it leaving processes behind that you are killing manually?

Yes, this is described in the "Steps to Reproduce"

maxballenger avatar May 08 '24 18:05 maxballenger