Skip to content
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

Can't connect to windows using ssh server version 8.9+ #7272

Closed
c-lai opened this issue Sep 30, 2022 · 21 comments
Closed

Can't connect to windows using ssh server version 8.9+ #7272

c-lai opened this issue Sep 30, 2022 · 21 comments
Assignees
Labels
bug Issue identified by VS Code Team member as probable bug ssh Issue in vscode-remote SSH verified Verification succeeded
Milestone

Comments

@c-lai
Copy link

c-lai commented Sep 30, 2022

The issue is similar to #6348, but different.

I was able to SSH to the remote machine (Windows 11) from VScode successfully before, but after some windows updates on the remote machine, SSH doesn't work anymore. The issue is reproducible when I use either a macOS machine or a Ubuntu machine as the local machine.

Now I can SSH to the remote computer from terminal, but fail from VScode.

  • VSCode Version: 1.71.2 (Universal) Commit: 74b1f979648cc44d385a2286793c226e611f59e7
  • Local OS Version: macOS 12.6 / Ubuntu
  • Remote OS Version: Windows 11 22H2
  • Remote Extension/Connection Type: SSH
  • Logs:
[17:33:38.860] Log Level: 2
[17:33:38.862] remote-ssh@0.84.0
[17:33:38.862] darwin x64
[17:33:38.868] SSH Resolver called for "ssh-remote+7b22686f73744e616d65223a224a4152564953227d", attempt 1
[17:33:38.868] "remote.SSH.useLocalServer": true
[17:33:38.869] "remote.SSH.path": undefined
[17:33:38.869] "remote.SSH.configFile": undefined
[17:33:38.869] "remote.SSH.useFlock": true
[17:33:38.869] "remote.SSH.lockfilesInTmp": false
[17:33:38.870] "remote.SSH.localServerDownload": auto
[17:33:38.870] "remote.SSH.remoteServerListenOnSocket": false
[17:33:38.870] "remote.SSH.showLoginTerminal": false
[17:33:38.870] "remote.SSH.defaultExtensions": []
[17:33:38.870] "remote.SSH.loglevel": 2
[17:33:38.871] "remote.SSH.enableDynamicForwarding": true
[17:33:38.871] "remote.SSH.enableRemoteCommand": false
[17:33:38.871] "remote.SSH.serverPickPortsFromRange": {}
[17:33:38.871] "remote.SSH.serverInstallPath": {}
[17:33:38.886] SSH Resolver called for host: JARVIS
[17:33:38.886] Setting up SSH remote "JARVIS"
[17:33:38.888] Acquiring local install lock: /var/folders/sr/0x6g643911z4fv3vjczyj_3r0000gn/T/vscode-remote-ssh-3446c8c4-install.lock
[17:33:38.891] Looking for existing server data file at /Users/changxin/Library/Application Support/Code/User/globalStorage/ms-vscode-remote.remote-ssh/vscode-ssh-host-3446c8c4-74b1f979648cc44d385a2286793c226e611f59e7-0.84.0/data.json
[17:33:38.891] Using commit id "74b1f979648cc44d385a2286793c226e611f59e7" and quality "stable" for server
[17:33:38.894] Install and start server if needed
[17:33:38.897] PATH: /Users/changxin/opt/miniconda3/bin:/Users/changxin/opt/miniconda3/condabin:/usr/local/bin:/usr/bin:/bin:/usr/sbin:/sbin:/Library/TeX/texbin:/opt/X11/bin
[17:33:38.898] Checking ssh with "ssh -V"
[17:33:38.904] > OpenSSH_8.6p1, LibreSSL 3.3.6

[17:33:38.907] askpass server listening on /var/folders/sr/0x6g643911z4fv3vjczyj_3r0000gn/T/vscode-ssh-askpass-ec7620451599a92ba4f83d7d92e59f3e388bc639.sock
[17:33:38.907] Spawning local server with {"serverId":1,"ipcHandlePath":"/var/folders/sr/0x6g643911z4fv3vjczyj_3r0000gn/T/vscode-ssh-askpass-6bc337707a9a28dc416e8ff061535730120eee63.sock","sshCommand":"ssh","sshArgs":["-v","-T","-D","53531","-o","ConnectTimeout=15","JARVIS"],"serverDataFolderName":".vscode-server","dataFilePath":"/Users/changxin/Library/Application Support/Code/User/globalStorage/ms-vscode-remote.remote-ssh/vscode-ssh-host-3446c8c4-74b1f979648cc44d385a2286793c226e611f59e7-0.84.0/data.json"}
[17:33:38.907] Local server env: {"SSH_AUTH_SOCK":"/private/tmp/com.apple.launchd.kGS0nenEVs/Listeners","SHELL":"/bin/zsh","DISPLAY":"/private/tmp/com.apple.launchd.DLms8dN3D7/org.macosforge.xquartz:0","ELECTRON_RUN_AS_NODE":"1","SSH_ASKPASS":"/Users/changxin/.vscode/extensions/ms-vscode-remote.remote-ssh-0.84.0/out/local-server/askpass.sh","VSCODE_SSH_ASKPASS_NODE":"/Applications/Visual Studio Code.app/Contents/Frameworks/Code Helper.app/Contents/MacOS/Code Helper","VSCODE_SSH_ASKPASS_EXTRA_ARGS":"--ms-enable-electron-run-as-node","VSCODE_SSH_ASKPASS_MAIN":"/Users/changxin/.vscode/extensions/ms-vscode-remote.remote-ssh-0.84.0/out/askpass-main.js","VSCODE_SSH_ASKPASS_HANDLE":"/var/folders/sr/0x6g643911z4fv3vjczyj_3r0000gn/T/vscode-ssh-askpass-ec7620451599a92ba4f83d7d92e59f3e388bc639.sock"}
[17:33:38.908] Spawned 7390
[17:33:39.066] > local-server-1> Spawned ssh, pid=7394
[17:33:39.070] stderr> OpenSSH_8.6p1, LibreSSL 3.3.6
[17:33:39.157] stderr> debug1: Server host key: ssh-ed25519 SHA256:L2T8ljfD5yYxWCKD8gBgMpnTG7XsUwW98NPXQYaCz+4
[17:33:39.285] stderr> Authenticated to 10.162.37.79 ([10.162.37.79]:22).
[17:33:40.189] stderr> client_loop: send disconnect: Broken pipe
[17:33:40.192] > local-server-1> ssh child died, shutting down
[17:33:40.198] Local server exit: 0
[17:33:40.199] Received install output: local-server-1> Spawned ssh, pid=7394
OpenSSH_8.6p1, LibreSSL 3.3.6
debug1: Server host key: ssh-ed25519 SHA256:L2T8ljfD5yYxWCKD8gBgMpnTG7XsUwW98NPXQYaCz+4
Authenticated to 10.162.37.79 ([10.162.37.79]:22).
client_loop: send disconnect: Broken pipe
local-server-1> ssh child died, shutting down

[17:33:40.199] Failed to parse remote port from server output
[17:33:40.201] Resolver error: Error: 
	at g.Create (/Users/changxin/.vscode/extensions/ms-vscode-remote.remote-ssh-0.84.0/out/extension.js:1:585222)
	at t.handleInstallOutput (/Users/changxin/.vscode/extensions/ms-vscode-remote.remote-ssh-0.84.0/out/extension.js:1:583874)
	at Object.e [as tryInstallWithLocalServer] (/Users/changxin/.vscode/extensions/ms-vscode-remote.remote-ssh-0.84.0/out/extension.js:1:624373)
	at process.processTicksAndRejections (node:internal/process/task_queues:96:5)
	at async /Users/changxin/.vscode/extensions/ms-vscode-remote.remote-ssh-0.84.0/out/extension.js:1:643506
	at async t.withShowDetailsEvent (/Users/changxin/.vscode/extensions/ms-vscode-remote.remote-ssh-0.84.0/out/extension.js:1:647224)
	at async /Users/changxin/.vscode/extensions/ms-vscode-remote.remote-ssh-0.84.0/out/extension.js:1:622845
	at async T (/Users/changxin/.vscode/extensions/ms-vscode-remote.remote-ssh-0.84.0/out/extension.js:1:619351)
	at async t.resolveWithLocalServer (/Users/changxin/.vscode/extensions/ms-vscode-remote.remote-ssh-0.84.0/out/extension.js:1:622460)
	at async t.resolve (/Users/changxin/.vscode/extensions/ms-vscode-remote.remote-ssh-0.84.0/out/extension.js:1:644834)
	at async /Users/changxin/.vscode/extensions/ms-vscode-remote.remote-ssh-0.84.0/out/extension.js:1:727082
[17:33:40.205] ------

Does this issue occur when you try this locally?: No

I tried SSH on the remote computer to itself (via IP) using VScode, and it succeeded.

Thanks

@github-actions github-actions bot added the ssh Issue in vscode-remote SSH label Sep 30, 2022
@c-lai
Copy link
Author

c-lai commented Oct 2, 2022

The issue is similar to #6348, but different.

I was able to SSH to the remote machine (Windows 11) from VScode successfully before, but after some windows updates on the remote machine, SSH doesn't work anymore. The issue is reproducible when I use either a macOS machine or a Ubuntu machine as the local machine.

Now I can SSH to the remote computer from terminal, but fail from VScode.

  • VSCode Version: 1.71.2 (Universal) Commit: 74b1f979648cc44d385a2286793c226e611f59e7
  • Local OS Version: macOS 12.6 / Ubuntu
  • Remote OS Version: Windows 11 22H2
  • Remote Extension/Connection Type: SSH
  • Logs:
[17:33:38.860] Log Level: 2
[17:33:38.862] remote-ssh@0.84.0
[17:33:38.862] darwin x64
[17:33:38.868] SSH Resolver called for "ssh-remote+7b22686f73744e616d65223a224a4152564953227d", attempt 1
[17:33:38.868] "remote.SSH.useLocalServer": true
[17:33:38.869] "remote.SSH.path": undefined
[17:33:38.869] "remote.SSH.configFile": undefined
[17:33:38.869] "remote.SSH.useFlock": true
[17:33:38.869] "remote.SSH.lockfilesInTmp": false
[17:33:38.870] "remote.SSH.localServerDownload": auto
[17:33:38.870] "remote.SSH.remoteServerListenOnSocket": false
[17:33:38.870] "remote.SSH.showLoginTerminal": false
[17:33:38.870] "remote.SSH.defaultExtensions": []
[17:33:38.870] "remote.SSH.loglevel": 2
[17:33:38.871] "remote.SSH.enableDynamicForwarding": true
[17:33:38.871] "remote.SSH.enableRemoteCommand": false
[17:33:38.871] "remote.SSH.serverPickPortsFromRange": {}
[17:33:38.871] "remote.SSH.serverInstallPath": {}
[17:33:38.886] SSH Resolver called for host: JARVIS
[17:33:38.886] Setting up SSH remote "JARVIS"
[17:33:38.888] Acquiring local install lock: /var/folders/sr/0x6g643911z4fv3vjczyj_3r0000gn/T/vscode-remote-ssh-3446c8c4-install.lock
[17:33:38.891] Looking for existing server data file at /Users/changxin/Library/Application Support/Code/User/globalStorage/ms-vscode-remote.remote-ssh/vscode-ssh-host-3446c8c4-74b1f979648cc44d385a2286793c226e611f59e7-0.84.0/data.json
[17:33:38.891] Using commit id "74b1f979648cc44d385a2286793c226e611f59e7" and quality "stable" for server
[17:33:38.894] Install and start server if needed
[17:33:38.897] PATH: /Users/changxin/opt/miniconda3/bin:/Users/changxin/opt/miniconda3/condabin:/usr/local/bin:/usr/bin:/bin:/usr/sbin:/sbin:/Library/TeX/texbin:/opt/X11/bin
[17:33:38.898] Checking ssh with "ssh -V"
[17:33:38.904] > OpenSSH_8.6p1, LibreSSL 3.3.6

[17:33:38.907] askpass server listening on /var/folders/sr/0x6g643911z4fv3vjczyj_3r0000gn/T/vscode-ssh-askpass-ec7620451599a92ba4f83d7d92e59f3e388bc639.sock
[17:33:38.907] Spawning local server with {"serverId":1,"ipcHandlePath":"/var/folders/sr/0x6g643911z4fv3vjczyj_3r0000gn/T/vscode-ssh-askpass-6bc337707a9a28dc416e8ff061535730120eee63.sock","sshCommand":"ssh","sshArgs":["-v","-T","-D","53531","-o","ConnectTimeout=15","JARVIS"],"serverDataFolderName":".vscode-server","dataFilePath":"/Users/changxin/Library/Application Support/Code/User/globalStorage/ms-vscode-remote.remote-ssh/vscode-ssh-host-3446c8c4-74b1f979648cc44d385a2286793c226e611f59e7-0.84.0/data.json"}
[17:33:38.907] Local server env: {"SSH_AUTH_SOCK":"/private/tmp/com.apple.launchd.kGS0nenEVs/Listeners","SHELL":"/bin/zsh","DISPLAY":"/private/tmp/com.apple.launchd.DLms8dN3D7/org.macosforge.xquartz:0","ELECTRON_RUN_AS_NODE":"1","SSH_ASKPASS":"/Users/changxin/.vscode/extensions/ms-vscode-remote.remote-ssh-0.84.0/out/local-server/askpass.sh","VSCODE_SSH_ASKPASS_NODE":"/Applications/Visual Studio Code.app/Contents/Frameworks/Code Helper.app/Contents/MacOS/Code Helper","VSCODE_SSH_ASKPASS_EXTRA_ARGS":"--ms-enable-electron-run-as-node","VSCODE_SSH_ASKPASS_MAIN":"/Users/changxin/.vscode/extensions/ms-vscode-remote.remote-ssh-0.84.0/out/askpass-main.js","VSCODE_SSH_ASKPASS_HANDLE":"/var/folders/sr/0x6g643911z4fv3vjczyj_3r0000gn/T/vscode-ssh-askpass-ec7620451599a92ba4f83d7d92e59f3e388bc639.sock"}
[17:33:38.908] Spawned 7390
[17:33:39.066] > local-server-1> Spawned ssh, pid=7394
[17:33:39.070] stderr> OpenSSH_8.6p1, LibreSSL 3.3.6
[17:33:39.157] stderr> debug1: Server host key: ssh-ed25519 SHA256:L2T8ljfD5yYxWCKD8gBgMpnTG7XsUwW98NPXQYaCz+4
[17:33:39.285] stderr> Authenticated to 10.162.37.79 ([10.162.37.79]:22).
[17:33:40.189] stderr> client_loop: send disconnect: Broken pipe
[17:33:40.192] > local-server-1> ssh child died, shutting down
[17:33:40.198] Local server exit: 0
[17:33:40.199] Received install output: local-server-1> Spawned ssh, pid=7394
OpenSSH_8.6p1, LibreSSL 3.3.6
debug1: Server host key: ssh-ed25519 SHA256:L2T8ljfD5yYxWCKD8gBgMpnTG7XsUwW98NPXQYaCz+4
Authenticated to 10.162.37.79 ([10.162.37.79]:22).
client_loop: send disconnect: Broken pipe
local-server-1> ssh child died, shutting down

[17:33:40.199] Failed to parse remote port from server output
[17:33:40.201] Resolver error: Error: 
	at g.Create (/Users/changxin/.vscode/extensions/ms-vscode-remote.remote-ssh-0.84.0/out/extension.js:1:585222)
	at t.handleInstallOutput (/Users/changxin/.vscode/extensions/ms-vscode-remote.remote-ssh-0.84.0/out/extension.js:1:583874)
	at Object.e [as tryInstallWithLocalServer] (/Users/changxin/.vscode/extensions/ms-vscode-remote.remote-ssh-0.84.0/out/extension.js:1:624373)
	at process.processTicksAndRejections (node:internal/process/task_queues:96:5)
	at async /Users/changxin/.vscode/extensions/ms-vscode-remote.remote-ssh-0.84.0/out/extension.js:1:643506
	at async t.withShowDetailsEvent (/Users/changxin/.vscode/extensions/ms-vscode-remote.remote-ssh-0.84.0/out/extension.js:1:647224)
	at async /Users/changxin/.vscode/extensions/ms-vscode-remote.remote-ssh-0.84.0/out/extension.js:1:622845
	at async T (/Users/changxin/.vscode/extensions/ms-vscode-remote.remote-ssh-0.84.0/out/extension.js:1:619351)
	at async t.resolveWithLocalServer (/Users/changxin/.vscode/extensions/ms-vscode-remote.remote-ssh-0.84.0/out/extension.js:1:622460)
	at async t.resolve (/Users/changxin/.vscode/extensions/ms-vscode-remote.remote-ssh-0.84.0/out/extension.js:1:644834)
	at async /Users/changxin/.vscode/extensions/ms-vscode-remote.remote-ssh-0.84.0/out/extension.js:1:727082
[17:33:40.205] ------

Does this issue occur when you try this locally?: No

I tried SSH on the remote computer to itself (via IP) using VScode, and it succeeded.

Thanks

I tried SSH from another windows 11 machine, and it succeeded. I guess this issue is due to some incompatibility between OpenSSH, which is used on macOS and Linux, and Win32-OpenSSH, which is used on Windows.

@sladiri
Copy link

sladiri commented Oct 7, 2022

I have the same problem, connecting from my Linux machine into Windows. It has been reported here as well: #6559

I checked and after Windows Update 22H2 the OpenSSH version indeed changed.

Please note that, as far as I understand:

  1. to create an issue for Win32-OpenSSH you need to test it on the latest version
  2. there is no download for the binary, you have to compile it yourself
  3. even if they can fix the bug, it would still be a problem for VSCode users, becuse I doubt many could compile the new version themselves

So whoever is responsible for bundling the version with Windows updates, should fix the version, otherwise people are stuck with an out of date Windows.

@eleanorjboyd
Copy link
Member

Could you figure out which version of the OpenSSH server you have? You are able to add this setting "remote.SSH.remotePlatform": { "YOUR_HOSTNAME": "windows" } in user settings file it should apply the workaround.

@eleanorjboyd eleanorjboyd self-assigned this Oct 13, 2022
@eleanorjboyd eleanorjboyd added the info-needed Issue requires more information from poster label Oct 13, 2022
@sladiri
Copy link

sladiri commented Oct 17, 2022

Thanks, that setting fixed the problem.

Also here are the versions of OpenSSH installed on the Windows PC:

"Non-working" version (after WIndows 22H2 update):
OpenSSH_for_Windows_8.6p1, LibreSSL 3.4.3

The "working" version is:
OpenSSH_for_Windows_8.1p1, LibreSSL 3.0.2

Edit
I wanted to add that while VS Code seems fine, my terminal SSH sessions outside of VS Code seem to lag weirdly with the new OpenSSH version. Mostly git commands seem to hang often. I do connect to a Qemu Windows VM in Fedora 36, so maybe that is some VM issue.

@c-lai
Copy link
Author

c-lai commented Oct 17, 2022

Could you figure out which version of the OpenSSH server you have? You are able to add this setting "remote.SSH.remotePlatform": { "YOUR_HOSTNAME": "windows" } in user settings file it should apply the workaround.

The setting fixed the problem for me as well. Thanks!

@roblourens roblourens added bug Issue identified by VS Code Team member as probable bug and removed info-needed Issue requires more information from poster labels Oct 18, 2022
@roblourens
Copy link
Member

This looks like a regression of PowerShell/Win32-OpenSSH#1545

$ echo "echo hello" | ssh localWin 
Pseudo-terminal will not be allocated because stdin is not a terminal.
roblou@10.211.55.3's password:
Windows PowerShell
Copyright (C) Microsoft Corporation. All rights reserved.

Try the new cross-platform PowerShell https://aka.ms/pscore6

PS C:\Users\roblou> echo hello
hello

With the 8.9.1 beta from https://github.com/PowerShell/Win32-OpenSSH/releases/tag/v8.9.1.0p1-Beta

$ echo "echo hello" | ssh localWin
Pseudo-terminal will not be allocated because stdin is not a terminal.
roblou@10.211.55.3's password:
client_loop: send disconnect: Broken pipe

$ echo "echo hello" | ssh localWin powershell  
roblou@10.211.55.3's password:
Windows PowerShell
Copyright (C) Microsoft Corporation. All rights reserved.

Try the new cross-platform PowerShell https://aka.ms/pscore6

PS C:\Users\roblou> echo hello
hello

And given your results above, it actually looks like the released 8.6 has the same problem. Could you try those two commands (echo "echo hello" | ssh YOUR_HOST and also with appending powershell) to confirm?

@ysig
Copy link

ysig commented Nov 13, 2022

I could perfectly connect to all my ssh connections with visual studio code and now that I updated to windows 11 22H2 it doesn't work. When will this be fixed, it's a crucial issue..?

@eleanorjboyd
Copy link
Member

Hello @ysig, did you try the setting- "remote.SSH.remotePlatform": { "YOUR_HOSTNAME": "windows" } and does that fix it for you? We have also added a patch fix for this to our next milestone since it might be a bit before the regression fix is made upstream: #7519

@ysig
Copy link

ysig commented Nov 15, 2022

Hello @eleanorjboyd. Setting it where? And what should you be the "YOUR_HOSTNAME" tag?

Thanks,
Y

@eleanorjboyd
Copy link
Member

you can put it in your settings.json and that should work and your host name is the name of your remote host you are trying to connect to like this example below of what your ssh config looks like:
Host dev
HostName dev.example.com
User john
Port 2322

@eleanorjboyd eleanorjboyd added the info-needed Issue requires more information from poster label Nov 15, 2022
@ysig
Copy link

ysig commented Nov 16, 2022

Hi @eleanorjboyd! Thank you for your answer. No it doesn't :/ Also my remote host is a linux host not a windows one and even changing that doesn't fix the issue. BTW I can totally connect through wsl.

@eleanorjboyd
Copy link
Member

@ysig Can you open a new issue for this since we know it is not related to the above fix and is on a different machine type? I will respond to investigate it further there but want to create a new thread to not clutter this one. Thanks!

@ysig
Copy link

ysig commented Nov 16, 2022 via email

@eleanorjboyd
Copy link
Member

@ysig logs from remote-ssh would be great! You can find them through going to the output tab on your server side VS Code then select remote-ssh from the dropdown.

@github-actions
Copy link

github-actions bot commented Dec 1, 2022

This issue has been closed automatically because it needs more information and has not had recent activity. See also our issue reporting guidelines.

Happy Coding!

@github-actions github-actions bot closed this as not planned Won't fix, can't repro, duplicate, stale Dec 1, 2022
@chadbrewbaker
Copy link

chadbrewbaker commented Dec 10, 2022

Why is this closed? Same issue. Can ssh fine but vscode-remote barfs on a broken pipe. @eleanorjboyd I used @shanselman setup Windows 11 side, https://www.hanselman.com/blog/the-easy-way-how-to-ssh-into-bash-and-wsl2-on-windows-10-from-an-external-machine I am using vscode 1.74.0 on MacOS M1 Ventura to connect. WSL is ubuntu 22.04 LTS.

Looks like ~/.vscode/extensions/ms-vscode-remote.remote-ssh-0.94.0/out/local-server/askpass.sh is the script it calls?

14:33:21.281] Log Level: 2
[14:33:21.287] remote-ssh@0.94.0
[14:33:21.287] darwin x64
[14:33:21.302] SSH Resolver called for "ssh-remote+XXXX", attempt 1
[14:33:21.303] "remote.SSH.useLocalServer": true
[14:33:21.304] "remote.SSH.path": undefined
[14:33:21.305] "remote.SSH.configFile": undefined
[14:33:21.306] "remote.SSH.useFlock": true
[14:33:21.306] "remote.SSH.lockfilesInTmp": false
[14:33:21.306] "remote.SSH.localServerDownload": auto
[14:33:21.306] "remote.SSH.remoteServerListenOnSocket": false
[14:33:21.306] "remote.SSH.showLoginTerminal": false
[14:33:21.306] "remote.SSH.defaultExtensions": []
[14:33:21.306] "remote.SSH.loglevel": 2
[14:33:21.306] "remote.SSH.enableDynamicForwarding": true
[14:33:21.306] "remote.SSH.enableRemoteCommand": false
[14:33:21.307] "remote.SSH.serverPickPortsFromRange": {}
[14:33:21.308] "remote.SSH.serverInstallPath": {}
[14:33:21.317] SSH Resolver called for host: XXXX
[14:33:21.318] Setting up SSH remote "XXXX"
[14:33:21.326] Acquiring local install lock: /var/folders/vy/1f7ldlk14z77k1t9rk0b_wzr0000gn/T/vscode-remote-ssh-e08b995c-install.lock
[14:33:21.331] Looking for existing server data file at /Users/USER/Library/Application Support/Code/User/globalStorage/ms-vscode-remote.remote-ssh/vscode-ssh-host-e08b995c-5235c6bb189b60b01b1f49062f4ffa42384f8c91-0.94.0/data.json
[14:33:21.334] Using commit id "5235c6bb189b60b01b1f49062f4ffa42384f8c91" and quality "stable" for server
[14:33:21.345] Install and start server if needed
[14:33:21.360] PATH: XXXXXXXX
[14:33:21.361] Checking ssh with "ssh -V"
[14:33:21.433] > OpenSSH_9.0p1, LibreSSL 3.3.6

[14:33:21.437] askpass server listening on /var/folders/vy/1f7ldlk14z77k1t9rk0b_wzr0000gn/T/vscode-ssh-askpass-0a970b9e17f857933d77da8376cb504a4eef35fa.sock
[14:33:21.439] Spawning local server with {"serverId":1,"ipcHandlePath":"/var/folders/vy/1f7ldlk14z77k1t9rk0b_wzr0000gn/T/vscode-ssh-askpass-aba325d16494ef6dae5f078e22990ba961cf4f1e.sock","sshCommand":"ssh","sshArgs":["-v","-T","-D","50393","-o","ConnectTimeout=15","beast"],"serverDataFolderName":".vscode-server","dataFilePath":"/Users/MYUSER/Library/Application Support/Code/User/globalStorage/ms-vscode-remote.remote-ssh/vscode-ssh-host-e08b995c-5235c6bb189b60b01b1f49062f4ffa42384f8c91-0.94.0/data.json"}
[14:33:21.440] Local server env: {"SSH_AUTH_SOCK":"/private/tmp/com.apple.launchd.SeMUKPGngm/Listeners","SHELL":"/bin/zsh","DISPLAY":"/private/tmp/com.apple.launchd.tDBKJkiIlA/org.xquartz:0","ELECTRON_RUN_AS_NODE":"1","SSH_ASKPASS":"/Users/MYUSER/.vscode/extensions/ms-vscode-remote.remote-ssh-0.94.0/out/local-server/askpass.sh","VSCODE_SSH_ASKPASS_NODE":"/Applications/vscode.app/Contents/Frameworks/Code Helper.app/Contents/MacOS/Code Helper","VSCODE_SSH_ASKPASS_EXTRA_ARGS":"--ms-enable-electron-run-as-node","VSCODE_SSH_ASKPASS_MAIN":"/Users/MYUSER/.vscode/extensions/ms-vscode-remote.remote-ssh-0.94.0/out/askpass-main.js","VSCODE_SSH_ASKPASS_HANDLE":"/var/folders/vy/1f7ldlk14z77k1t9rk0b_wzr0000gn/T/vscode-ssh-askpass-0a970b9e17f857933d77da8376cb504a4eef35fa.sock"}
[14:33:21.448] Spawned 719
[14:33:21.717] > local-server-1> Running ssh connection command: "-v -T -D 50393 -o ConnectTimeout=15 XXXX"
[14:33:21.722] > local-server-1> Spawned ssh, pid=734
[14:33:21.744] stderr> OpenSSH_9.0p1, LibreSSL 3.3.6
[14:33:21.879] stderr> debug1: Server host key: ssh-ed25519 SHA256:JXGPRQ4cAF2bVbai9IQF1vHpCLZfIQbJwk5HTdNTXqo
[14:33:22.584] Got askpass request: {"request":"MYUSER@SOME_IP's password:"}
[14:33:22.586] Showing password prompt
[14:33:22.587] Listening for interwindow password on /var/folders/vy/1f7ldlk14z77k1t9rk0b_wzr0000gn/T/vscode-ssh-askpass-fe97cfdd2c19c8844704c5a9493a6afac47676cd.sock
[14:33:22.588] Writing password prompt to globalState
[14:33:26.837] Got password response
[14:33:26.839] Interactor gave response: ************************
[14:33:26.842] Cleaning up other-window auth server
[14:33:26.995] stderr> Authenticated to SOME_IP ([SOME_IP]:22) using "password".
[14:33:28.547] stderr> client_loop: send disconnect: Broken pipe
[14:33:28.548] > local-server-1> ssh child died, shutting down
[14:33:28.558] Local server exit: 0
[14:33:28.559] Received install output: local-server-1> Running ssh connection command: "-v -T -D 50393 -o ConnectTimeout=15 XXXX"
local-server-1> Spawned ssh, pid=734
OpenSSH_9.0p1, LibreSSL 3.3.6
debug1: Server host key: ssh-ed25519 SHA256:SOME_SHA
Authenticated to SOME_IP ([SOME_IP]:22) using "password".
client_loop: send disconnect: Broken pipe
local-server-1> ssh child died, shutting down

[14:33:28.562] Failed to parse remote port from server output
[14:33:28.567] Resolver error: Error:
at g.Create (/Users/USER/.vscode/extensions/ms-vscode-remote.remote-ssh-0.94.0/out/extension.js:1:583926)
at t.handleInstallOutput (/Users/USER/.vscode/extensions/ms-vscode-remote.remote-ssh-0.94.0/out/extension.js:1:582540)
at Object.e [as tryInstallWithLocalServer] (/Users/USER2/.vscode/extensions/ms-vscode-remote.remote-ssh-0.94.0/out/extension.js:1:623191)
at process.processTicksAndRejections (node:internal/process/task_queues:96:5)
at async /Users/USER/.vscode/extensions/ms-vscode-remote.remote-ssh-0.94.0/out/extension.js:1:642446
at async t.withShowDetailsEvent (/Users/USER/.vscode/extensions/ms-vscode-remote.remote-ssh-0.94.0/out/extension.js:1:646166)
at async /Users/USER/.vscode/extensions/ms-vscode-remote.remote-ssh-0.94.0/out/extension.js:1:621663
at async T (/Users/USER/.vscode/extensions/ms-vscode-remote.remote-ssh-0.94.0/out/extension.js:1:618169)
at async t.resolveWithLocalServer (/Users/USER/.vscode/extensions/ms-vscode-remote.remote-ssh-0.94.0/out/extension.js:1:621278)
at async t.resolve (/Users/USER/.vscode/extensions/ms-vscode-remote.remote-ssh-0.94.0/out/extension.js:1:643774)
at async /Users/USER/.vscode/extensions/ms-vscode-remote.remote-ssh-0.94.0/out/extension.js:1:723024
[14:33:28.587] ------

@chadbrewbaker
Copy link

chadbrewbaker commented Dec 10, 2022

I think I fixed it? I disabled use local server and I set remote.SSH.connectTimeout to 60 seconds.

#1761 should be re-opened? 60 seems like a more sane setting.

Would it be better to ssh in and run this, then connect with the client?:

curl -fsSL https://code-server.dev/install.sh | sh

@eleanorjboyd
Copy link
Member

Hello! Could you try steps 2 and 3 of this guide and let me know the outcome? Also could you try increasing your ssh connection timeout to 30 from 15. Thanks!

https://github.com/microsoft/vscode-remote-release/wiki/Debugging-for-Remote-SSH

@eleanorjboyd eleanorjboyd reopened this Dec 15, 2022
@provos
Copy link

provos commented Dec 16, 2022

I just ran into this problem and the solution was to set

"remote.SSH.useLocalServer": false

@roblourens roblourens changed the title SSH from VScode fails but from terminal SSH works Can't connect to windows using ssh server version 8.9+ Dec 17, 2022
@roblourens roblourens removed the info-needed Issue requires more information from poster label Dec 17, 2022
@lpxgita
Copy link

lpxgita commented Feb 10, 2023

Thanks @provos , more detailed information can be found in VSC‘s docs
https://code.visualstudio.com/docs/remote/troubleshooting

@eleanorjboyd eleanorjboyd reopened this Feb 11, 2023
@eleanorjboyd eleanorjboyd added the verification-needed Verification of issue is requested label Feb 20, 2023
@eleanorjboyd
Copy link
Member

steps to verify:

  1. using vscode insiders switch the newest version of the remote-ssh extension
  2. have a server that is a windows machine that is running Open-SSH version 8.9 beta (any version 8.6 and up should work but we know this issue shows up on 8.6 and 8.9-beta) https://github.com/PowerShell/Win32-OpenSSH/releases/tag/v8.9.1.0p1-Beta
  3. to install download the zip, run install-sshd which should replace your server (you might have to delete your old sshd instance not totally sure) then start the server
  4. you can check your remote openSSH version by connecting using the -v tag with ssh ssh ____ -v
  5. Now see if you can correctly connect (and check it prompts you for your password a second time, if not you might need to remove the machine type from your json file if it is defined there)

@roblourens roblourens added this to the February 2023 milestone Feb 21, 2023
@bhavyaus bhavyaus added verified Verification succeeded and removed verification-needed Verification of issue is requested labels Feb 22, 2023
@github-actions github-actions bot locked and limited conversation to collaborators Apr 8, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
bug Issue identified by VS Code Team member as probable bug ssh Issue in vscode-remote SSH verified Verification succeeded
Projects
None yet
Development

No branches or pull requests

9 participants