vscode: SSH remote not working in 1.43

  • VSCode Version: 1.43
  • OS Version: Windows 10 1903

Steps to Reproduce:

  1. Update from VSCode 1.42.1 to 1.43
  2. Connect to a remote host through its alias declared in %UserProfile%/.ssh/config

Expected behavior: An SSH session can be established to the remote machine. Behavior in reality: VSCode cannot connect, throwing “cannot resolve hostname” error. The problem can be partly mitigated by putting the IP address in etc/hosts, however settings (like IdentityFile in .ssh/config) are not respected.

EDIT: downgrade the Remote - SSH plugin to version 0.49.0 helped.

EDIT 2: official recommended workaround: set remote.SSH.useLocalServer to false on version 0.50.0 Some other things you can try:

  • Keep localServer on and configure remote.SSH.path to C:\Windows\System32\OpenSSH\ssh.exe

If nothing works for you, try other workarounds in this ticket or the other ticket

About this issue

  • Original URL
  • State: closed
  • Created 4 years ago
  • Reactions: 28
  • Comments: 25 (4 by maintainers)

Most upvoted comments

@tiptronic85 you can try downgrade the extension Remote - SSH version to 0.49.0, that worked for me. VSCode 1.43 automatically updated the extension to version 0.50.0.

We can confirm that reverting the Remote SSH extension to 0.49 is enough, no need to downgrade VS Code itself, no need to delete anything.

image

EDIT: I created an issue in the remote extensions repo too: https://github.com/microsoft/vscode-remote-release/issues/2513

@roblourens FYI You mentioned you planning to change the default for useLocalServer on Windows, but note that I had to set remote.SSH.useLocalServer to false on my VS Code running on Fedora 31 as well to work around the problem.

If I read the release notes right on 1.4.3, Remote SSH has changed the default of option remote.SSH.useLocalServer to true. It appears that this option, combined with a connection to an SSH server and user where the default shell is either 1) not BASH, 2) or is FISH (my case), the connection establishment hangs indefinitely.

Setting remote.SSH.useLocalServer to false OR setting the default shell to BASH resolves the issue. So the problem likely has to do with the interaction between the Local Server mode and FISH (perhaps shells other than BASH also have this issue).

Can someone explain why enabling remote.SSH.useLocalServer makes VS Code choose the SSH executable in Git for Windows rather than that in %WINDIR%\System32\OpenSSH ?

I got the following in the output panel when trying to connect from Mac to Linux with version 0.50.0 of Remote - SSH:

[10:21:57.782] stderr> bash: line 1: syntax error near unexpected token `then'
[10:21:57.782] stderr> bash: line 1: `then'
[10:21:57.782] stderr> function: Command not found.
[10:21:57.783] stderr> COMMIT_ID=78a4c91400152c0f27ba4d363eb56d2835f9903a: Command not found.
[10:21:57.783] > 4f0acc8d1184: running
[10:21:57.783] stderr> EXTENSIONS=: Command not found.
[10:21:57.783] stderr> TELEMETRY=: Command not found.
[10:21:57.784] stderr> export: Command not found.
[10:21:57.784] stderr> ALLOW_CLIENT_DOWNLOAD=1: Command not found.
[10:21:57.784] stderr> VSCODE_AGENT_FOLDER: Undefined variable.
[10:21:57.785] stderr> _lock: Command not found.

VS Code was just hanging doing nothing. Going back to Remote - SSH 0.49.0 solved this for me too.

Edit: In the light of what radcool has found (https://github.com/microsoft/vscode/issues/92331#issuecomment-597340644) I should probably mention that my default shell is tcsh.