Set RemoteCommand in ssh config for removing .vscode-server

76 Views Asked by At

I am having issues with Remote SSH in VS Code.

When connecting to my server, often the process is failing (infinite retry) unless I delete the .vscode-server folder or (better) the content of .vscode-server/bin/*.

While this is strange, I found many other users with a similar issue. Since I don't want to do this manually at every connection, I was thinking about setting a RemoteCommand rm -rf .vscode-server/bin/* in my ssh config.

I did it and enabled the remote command feature in VS code (since it's not automatically enabled) and enabled local server usage, as per VS Code documentation. As expected, things are poorly failing:

12:19:29.673] Spawned 4226
[12:19:29.770] > local-server-3> Running ssh connection command: ssh -v -T -D 50266 -o ConnectTimeout=15 lxpvs
[12:19:29.771] > local-server-3> Spawned ssh, pid=4231
[12:19:29.773] stderr> OpenSSH_8.6p1, LibreSSL 3.3.6
[12:19:29.865] > local-server-3> ssh child died, shutting down
[12:19:29.867] Local server exit: 0
[12:19:29.868] Received install output: local-server-3> Running ssh connection command: ssh -v -T -D 50266 -o ConnectTimeout=15 lxpvs
local-server-3> Spawned ssh, pid=4231
OpenSSH_8.6p1, LibreSSL 3.3.6
local-server-3> ssh child died, shutting down

[12:19:29.868] Failed to parse remote port from server output
[12:19:29.868] Exec server for ssh-remote+lxpvs failed: Error
[12:19:29.868] Error opening exec server for ssh-remote+lxpvs: Error

It seems that the remote command is executed (I can issue a fake command and I will see proper outcome) but the connection is not established.

0

There are 0 best solutions below