vscode icon indicating copy to clipboard operation
vscode copied to clipboard

Agents view fails to connect to SSH hosts using ProxyJump, while main editor's SSH works

Open foresee-io opened this issue 6 months ago • 9 comments

  • VS Code Version: 1.120.0
  • OS Version: Darwin arm64 25.4.0

Steps to Reproduce:

  1. Define an SSH host in ~/.ssh/config that uses ProxyJump.
  2. Connect to the host via the standard editor SSH entry — works.
  3. Try connecting to the same host from the new Agents view — fails with EHOSTUNREACH.
Image

Expected: Agents view should honor ~/.ssh/config (including ProxyJump) and connect successfully.

Actual: Agents view cannot reach the host and immediately returns EHOSTUNREACH.

SSH config example:

host claude
    proxyJump jumpserver
    user var-x
    hostname var-c
    port 22
    identityfile var-b

host jumpserver
    user var-y
    hostname var-z
    port 22
    identityfile var-a

foresee-io avatar May 20 '26 02:05 foresee-io

i have the same problem

skywalk72 avatar May 20 '26 07:05 skywalk72

ProxyCommand seem to provoke the same sort of symptom.

kristofferpeterhansel avatar Jun 22 '26 11:06 kristofferpeterhansel

Have similar problem here.

In my case, I have some ProxyCommand in system global setting /etc/ssh/ssh_config, and the Agent View fail to establish the SSH connection, while the main VS Code editor works normally.

The connection mechanism of Agent View should be aligned with Remote SSH in VS Code editor.

Version: 1.133.0 (Universal)
Commit: a5b500951314efd502d07465bd138dfbd714a960

Workaround

As a workaround, I need to first establish a SSH connection with port forwarding.

ssh -N -L 2222:localhost:22 some-host

And create another record in the SSH config to connection through this forwarded port. Like

Host some-host-local-proxy
  HostName 127.0.0.1
  Port 2222

Then connect to some-host-local-proxy in Agent View.

wdhongtw avatar Aug 15 '26 13:08 wdhongtw

Hi @joshspicer , sorry for pinging. Do we have some idea or plan for this issue? 🙂‍↕️

wdhongtw avatar Aug 20 '26 02:08 wdhongtw

I reproduced this with a real key-authenticated single-hop ProxyJump setup and opened #334849. Agent Host resolved the target with ssh -G but discarded ProxyJump, so unpatched current main dialed the unreachable HostName directly and failed with ENOTFOUND; the patched build passes native OpenSSH's -W tunnel to ssh2, reaches the jump and target, launches the real Agent Host, and completes its forwarded WebSocket connection. A direct-host control still connects without starting a jump helper, and this PR intentionally does not add ProxyCommand, multi-hop, or interactive jump-host authentication.

— kondv's Copilot 🤖

kondv avatar Sep 08 '26 01:09 kondv

Still reproduces on Insiders 1.146.0 (macOS):

  • ~/.ssh/config with Host target (ProxyJump jump): ssh target from a terminal goes through the jump host and works.
  • Picking target in the Agents window SSH picker skips the jump host and dials the target's HostName directly. The jump host's sshd never sees a connection.
  • ProxyCommand is already supported on main. ProxyJump isn't parsed from ssh -G yet.

#334849 adds single-hop ProxyJump support and is open for review.

https://github.com/user-attachments/assets/f624269d-0f32-4fa3-a90e-338410828127

🤖 Authored with GitHub Copilot on behalf of @alexdima.

alexdima avatar Nov 08 '26 11:11 alexdima

This is fixed in the next Insiders. I've tested it but I would appreciate anyone else trying it out, because there are a wide variety of ssh configurations out there.

roblourens avatar Nov 12 '26 01:11 roblourens

This issue is addressed.

sunhs avatar Nov 12 '26 06:11 sunhs

This is fixed in the next Insiders. I've tested it but I would appreciate anyone else trying it out, because there are a wide variety of ssh configurations out there. Env: Version: 1.148.0-insider (user setup) Commit: ca70cf1a8b44ca31e91bc57595aa6054cbfcfa15 Date: 2026-11-17T16:42:44Z Electron: 43.8.10 ElectronBuildId: 16052126 Chromium: 150.0.7871.250 Node.js: 24.22.1 V8: 15.0.245.31-electron.0 @github/copilot: 1.0.111-0 @github/copilot-sdk: 1.0.33-preview.0 OS: Windows_NT x64 10.0.26200

Unable to connect via ssh using the following configuration in the agent 2026-11-17 16:28:30.470 [info] [Window] [SSHRemoteAgentHost] Host key decision for myServer: trust (stored) 2026-11-17 16:28:30.608 [error] [Window] [RemoteAgentHost] Failed to create a connection to ssh:myServer. Verify address and connectionToken All configured authentication methods failed 2026-11-17 16:28:30.609 [info] [Window] [RemoteAgentHost] Pausing SSH auto-reconnect for myServer after authentication failure

Host myServer HostName myServer User lostless13 Port 25730

I'm using bitwarden as the key provider.

lostless13 avatar Nov 17 '26 22:11 lostless13