I set up SSH on a remote machine & a local machine, with the intent of using VS Code SSH. I can connect to my remote with ssh
in the command line, but VS Code keeps dropping connections after successfully connecting with something like ssh child died, shutting down
.
Why can I connect via CLI SSH, but not VS Code? How do I fix this?
ssh -l REDACTED\citelao citelao-machine -vvv
works just finessh-agent
(How can I use Windows' built-in OpenSSH ssh-agent in VS Code, instead of Git bash's?)ServerAliveInterval 60
and ServerAliveCountMax 30
PubkeyAuthentication no
and PasswordAuthentication yes
(and tried with pubkey authentication)How do I fix this, so I can connect in VS Code?
Disable Remote.SSH: Use Local Server (set remote.SSH.useLocalServer
to false
):
Per Rob Lourens in this GitHub issue:
You are hitting a bug with some versions of the windows ssh server :/
Relevant logs from the issue (I couldn't get my own logs after fixing the issue):
[16:11:07.635] stderr> Authenticated to 127.0.0.1 ([127.0.0.1]:22).
[16:11:10.183] stderr> client_loop: send disconnect: Connection reset by peer
[16:11:10.244] > local-server-1> ssh child died, shutting down
[16:11:10.368] Local server exit: 0
// ...
client_loop: send disconnect: Connection reset by peer
local-server-1> ssh child died, shutting down
[16:11:10.370] Failed to parse remote port from server output
[16:11:10.374] Resolver error: Error:
at Function.Create (c:\Users\alros\.vscode-insiders\extensions\ms-vscode-remote.remote-ssh-0.79.2022040715\out\extension.js:1:585789)
at Object.t.handleInstallOutput (c:\Users\alros\.vscode-insiders\extensions\ms-vscode-remote.remote-ssh-0.79.2022040715\out\extension.js:1:584441)
at Object.e [as tryInstallWithLocalServer] (c:\Users\alros\.vscode-insiders\extensions\ms-vscode-remote.remote-ssh-0.79.2022040715\out\extension.js:1:624908)
at processTicksAndRejections (node:internal/process/task_queues:96:5)
at async c:\Users\alros\.vscode-insiders\extensions\ms-vscode-remote.remote-ssh-0.79.2022040715\out\extension.js:1:643945
at async Object.t.withShowDetailsEvent (c:\Users\alros\.vscode-insiders\extensions\ms-vscode-remote.remote-ssh-0.79.2022040715\out\extension.js:1:647692)
at async c:\Users\alros\.vscode-insiders\extensions\ms-vscode-remote.remote-ssh-0.79.2022040715\out\extension.js:1:623380
at async b (c:\Users\alros\.vscode-insiders\extensions\ms-vscode-remote.remote-ssh-0.79.2022040715\out\extension.js:1:619886)
at async Object.t.resolveWithLocalServer (c:\Users\alros\.vscode-insiders\extensions\ms-vscode-remote.remote-ssh-0.79.2022040715\out\extension.js:1:622995)
at async Object.t.resolve (c:\Users\alros\.vscode-insiders\extensions\ms-vscode-remote.remote-ssh-0.79.2022040715\out\extension.js:1:645302)
at async c:\Users\alros\.vscode-insiders\extensions\ms-vscode-remote.remote-ssh-0.79.2022040715\out\extension.js:1:722235
[16:11:10.380] ------