Skip to content

[Remote-SSH Bug]: SSH-Agent Forwarding stoped working #9662

@Crefok

Description

@Crefok

Is there an existing issue for this bug?

  • I have searched the existing issues

Required Troubleshooting Steps

  • I have followed these troubleshooting steps
  • I have tried both values of the remote.SSH.useLocalServer setting

Connect Locally

It connects successfully

->

No response

Expected Behavior

I would expect to get the ssh-agent forwarded to the ssh client. But that isn't working anymore.
If I directly connect to the same Host, the ssh agent is forwarded, and can be used.

Steps To Reproduce

  1. vs-code is updated to the newest version
  2. ssh-config ForwardAgent yes is set
  3. connect to the remote Host via vs code remote extension.
  4. try to connect to another host via integrated terminal an use the forwarded host key

Remote-SSH Log

Remote-SSH Log

[16:18:24.113] Log Level: 2
[16:18:24.118] VS Code version: 1.87.2
[16:18:24.118] Remote-SSH version: remote-ssh@0.109.0
[16:18:24.118] darwin arm64
[16:18:24.119] SSH Resolver called for "ssh-remote+edge01", attempt 1
[16:18:24.119] "remote.SSH.useLocalServer": true
[16:18:24.119] "remote.SSH.useExecServer": true
[16:18:24.119] "remote.SSH.path": undefined
[16:18:24.119] "remote.SSH.configFile": undefined
[16:18:24.119] "remote.SSH.useFlock": true
[16:18:24.119] "remote.SSH.lockfilesInTmp": false
[16:18:24.119] "remote.SSH.localServerDownload": auto
[16:18:24.119] "remote.SSH.remoteServerListenOnSocket": false
[16:18:24.120] "remote.SSH.showLoginTerminal": false
[16:18:24.120] "remote.SSH.defaultExtensions": []
[16:18:24.120] "remote.SSH.loglevel": 2
[16:18:24.120] "remote.SSH.enableDynamicForwarding": true
[16:18:24.120] "remote.SSH.enableRemoteCommand": false
[16:18:24.120] "remote.SSH.serverPickPortsFromRange": {}
[16:18:24.120] "remote.SSH.serverInstallPath": {}
[16:18:24.123] SSH Resolver called for host: edge01
[16:18:24.123] Setting up SSH remote "edge01"
[16:18:24.124] Acquiring local install lock: /var/folders/1_/vy1hm2gn3_z9vpxkgb65z0300000gq/T/vscode-remote-ssh-b74c3d4f-install.lock
[16:18:24.125] Looking for existing server data file at /Users/<USER>/Library/Application Support/Code/User/globalStorage/ms-vscode-remote.remote-ssh/vscode-ssh-host-b74c3d4f-863d2581ecda6849923a2118d93a088b0745d9d6-0.109.0-es/data.json
[16:18:24.126] Found local server running: {"remoteListeningOn":{"port":40560},"osReleaseId":"rhel","arch":"x86_64","sshAuthSock":"/tmp/ssh-djn2ienDq4/agent.275215","display":"","tmpDir":"/run/user/9264","platform":"linux","execServerToken":"f56215be-b7e7-4472-be03-0b3eb9f05ee2","pid":73244,"ipcHandlePath":"/var/folders/1_/vy1hm2gn3_z9vpxkgb65z0300000gq/T/vscode-ssh-askpass-af3f88910e8059a1d091bf39f1874ce63413ef4a.sock","socksPort":62312,"startupTime":1710514181093}
[16:18:24.128] Found running server - short-circuiting install
[16:18:24.130] Starting forwarding server. local port 61305 -> socksPort 62312 -> remotePort 40560
[16:18:24.130] Forwarding server listening on port 61305
[16:18:24.130] Waiting for ssh tunnel to be ready
[16:18:24.130] Tunneled port 40560 to local port 61305
[16:18:24.130] Resolved "ssh-remote+edge01" to "port 61305"
[16:18:24.134] Initizing new exec server for ssh-remote+edge01
[16:18:24.134] Resolving exec server at port 61305
[16:18:24.147] [Forwarding server port 61305] Got connection 0
[16:18:24.147] [Forwarding server port 61305] Got connection 1
[16:18:24.230] Exec server for ssh-remote+edge01 created and cached
[16:18:24.232] ------




[16:18:24.257] [server] Checking /home/<USER>/.vscode-server/cli/servers/Stable-863d2581ecda6849923a2118d93a088b0745d9d6/log.txt and /home/<USER>/.vscode-server/cli/servers/Stable-863d2581ecda6849923a2118d93a088b0745d9d6/pid.txt for a running server...
[16:18:24.296] [server] Found running server (pid=167271)
[16:22:34.771] ConfigFileWatcher: start watching file:///Users/<USER>/.ssh/config
[16:22:34.771] ConfigFileWatcher: adding save listener
[16:22:34.771] ConfigFileWatcher: adding close listener
[16:22:46.175] ConfigFileWatcher: start watching file:///etc/ssh/ssh_config
[16:22:55.403] ConfigFileWatcher: closing file:///etc/ssh/ssh_config
[16:22:55.403] ConfigFileWatcher: stop watching file:///etc/ssh/ssh_config
[16:23:23.641] ConfigFileWatcher: closing file:///Users/<USER>/.ssh/config
[16:23:23.641] ConfigFileWatcher: stop watching file:///Users/<USER>/.ssh/config
[16:23:23.641] ConfigFileWatcher: removing save listener
[16:23:23.641] ConfigFileWatcher: removing close listener

Anything else?

ssh-add -l via direct ssh connection to the hosts lists the same keys as on the notebook I connected to the host. These Keys are also set so use on other hosts

ssh-add -l got the following output, when used in the VS Code Bash Terminal.

ssh-add -l
Error connecting to agent: No such file or directory

VS Code Version

Version: 1.87.2
Commit: 863d2581ecda6849923a2118d93a088b0745d9d6
Datum: 2024-03-08T15:20:57.520Z (Vor 1 Woche(n))
Electron: 27.3.2
ElectronBuildId: 26836302
Chromium: 118.0.5993.159
Node.js: 18.17.1
V8: 11.8.172.18-electron.0
Betriebssystem: Darwin arm64 23.4.0

With VS Code Version does it work!

Version: 1.86.2
Commit: 903b1e9d8990623e3d7da1df3d33db3e42d80eda
Datum: 2024-02-13T19:42:12.210Z (Vor 1 Monat(en))
Electron: 27.2.3
ElectronBuildId: 26908389
Chromium: 118.0.5993.159
Node.js: 18.17.1
V8: 11.8.172.18-electron.0
Betriebssystem: Darwin arm64 23.4.0

Metadata

Metadata

Assignees

Labels

*duplicateIssue identified as a duplicate of another issue(s)bugIssue identified by VS Code Team member as probable bugsshIssue in vscode-remote SSH

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions