Steps to Reproduce:
ssh connect to hostXXXX
Does this issue occur when you try this locally?: No - Not applicable
Does this issue occur when you try this locally and all extensions are disabled?: Yes : Remote SSH Enabled needs to be enabled( This also adds the extension Remote -SSH: Editing Configuration Files)
[19:09:41.351] [email protected]
[19:09:41.351] linux x64
[19:09:41.358] SSH Resolver called for "ssh-remote+XXXX", attempt 1
[19:09:41.358] SSH Resolver called for host: XXXX
[19:09:41.358] Setting up SSH remote "XXXX"
[19:09:41.389] Using commit id "6ab598523be7a800d7f3eb4d92d7ab9a66069390" and quality "stable" for server
[19:09:41.391] Testing ssh with ssh -V
[19:09:41.397] ssh exited with code: 0
[19:09:41.398] Got stderr from ssh: OpenSSH_7.6p1 Ubuntu-4ubuntu0.3, OpenSSL 1.0.2n 7 Dec 2017
[19:09:41.400] Running script with connection command: ssh -T -D 46787 -o ConnectTimeout=15 XXXX bash
[19:09:41.400] Install and start server if needed
[19:09:58.404] Resolver error: Connecting with SSH timed out
[19:09:58.406] TELEMETRY: {"eventName":"resolver","properties":{"outcome":"failure","reason":"Timeout","askedPw":"0","askedPassphrase":"0","asked2fa":"0","askedHostKey":"0","gotUnrecognizedPrompt":"0","remoteInConfigFile":"1"},"measures":{"resolveAttempts":1,"retries":1}}
[19:09:58.407] ------
Can you connect from an external terminal?
Yes. The porblem was inconsitent behaviour when using the -T flag. Most of the times it would just timeout.
Now it is working again, but I had to purge vscode to do so. I also had to downgrade my vscode to work.
Hello there. I have the same issue (using the same version of vscode) except for -T is not used for connecting. Using an external terminal connects successfully.
[09:22:42.997] [email protected]
[09:22:42.997] linux x64
[09:22:42.998] SSH Resolver called for "ssh-remote+7b22686f73744e616d65223a2253746f6978696d616e535348536572766572436f6e7461696e6572227d", attempt 1
[09:22:42.998] SSH Resolver called for host: XXXX
[09:22:42.998] Setting up SSH remote "XXXX"
[09:22:43.009] Using commit id "6ab598523be7a800d7f3eb4d92d7ab9a66069390" and quality "stable" for server
[09:22:43.011] Testing ssh with ssh -V
[09:22:43.022] ssh exited with code: 0
[09:22:43.022] Got stderr from ssh: OpenSSH_7.6p1 Ubuntu-4ubuntu0.3, OpenSSL 1.0.2n 7 Dec 2017
[09:22:43.022] Running script with connection command: ssh -D 36887 -o ConnectTimeout=15 StoiximanSSHServerContainer bash
[09:22:43.022] Install and start server if needed
[09:23:00.023] Connecting with SSH timed out
[09:23:00.023] TELEMETRY: {"eventName":"resolver","properties":{"outcome":"failure","reason":"Timeout"},"measures":{"resolveAttempts":1,"retries":1}}
I am having the same issue.
When I try to connect to the remote machine I get:
[12:21:06.050] [email protected]
[12:21:06.050] linux x64
[12:21:06.057] SSH Resolver called for "ssh-remote+snoop", attempt 1
[12:21:06.057] SSH Resolver called for host: snoop
[12:21:06.057] Setting up SSH remote "snoop"
[12:21:06.082] Using commit id "6ab598523be7a800d7f3eb4d92d7ab9a66069390" and quality "stable" for server
[12:21:06.085] Testing ssh with ssh -V
[12:21:06.098] ssh exited with code: 0
[12:21:06.098] Got stderr from ssh: OpenSSH_7.6p1 Ubuntu-4ubuntu0.3, OpenSSL 1.0.2n 7 Dec 2017
[12:21:06.113] Running script with connection command: ssh -T -D 45093 -o ConnectTimeout=15 snoop bash
[12:21:06.113] Install and start server if needed
[12:21:23.117] Resolver error: Connecting with SSH timed out
[12:21:23.126] TELEMETRY: {"eventName":"resolver","properties":{"outcome":"failure","reason":"Timeout","askedPw":"0","askedPassphrase":"0","asked2fa":"0","askedHostKey":"0","gotUnrecognizedPrompt":"0","remoteInConfigFile":"1"},"measures":{"resolveAttempts":1,"retries":1}}
[12:21:23.134] ------
I have no problems connecting to the machine externally through the terminal using my ssh config. I've been using this remote connection for months without any issue, and I have not changed anyhting on the remote machine.
Yes. The porblem was inconsitent behaviour when using the
-Tflag. Most of the times it would just timeout.Now it is working again, but I had to purge vscode to do so. I also had to downgrade my vscode to work.
What version did you downgrade to?
So both of you, if you run a command like echo uname | ssh -D 36887 -o ConnectTimeout=15 yourhostname bash, then it works?
@roblourens I have the same issue as OP and your command works fine returning Linux
VSCode Version: 1.39.2
Remote - SSH extension Version: 0.47.2
Local OS Version: Ubuntu 18.04
Remote OS Version: Debian 4.9.130-2
I fixed my problem by completely removing VSCode and installing the new version. I had installed via snap, so I ran sudo snap remove vscode and rm -r ~/.code. After a clean install of VSCode 1.40 and the Remote - SSH package the issue was resolved.
I think removing '~/.code' is key, because I had previously tried re-installing VSCode and it didn't help.
In my case, I had to remove ~/.config/Code folder too. My Ubuntu version is 19.04
@roblourens : I no longer can replicate the problem because I still don't want to re-upgrade my vscode (I use remote SSH a lot I did not want to be hindered). But yes, I am 100% certain my ssh access was working and the uname would have return Linux, just as it does now.
Similar to others reports here, I had to purge local configs to get it to work again.
@klensink I downgraded to 1.39-0.
@roblourens : If @msemikin is no longer having issues, feel free to close this issue.
I might try an update to 1.40 like @klensink did later on.
Reinstalling code from official PPA and removing ~/.config/Code, ~/.var/app/com.visualstudio.code and ~/.vscode helped, no issues anymore!
I'm experiencing the same problem with:
Version: 1.41.0-insider
Commit: fe03510f9e9fb269ca35da0ea600dd95279fa2b7
Date: 2019-11-18T05:28:39.158Z
Electron: 6.1.4
Chrome: 76.0.3809.146
Node.js: 12.4.0
V8: 7.6.303.31-electron.0
OS: Linux x64 4.19.79-1-MANJARO
rm -rf .config/Code\ -\ Insiders/ helps once, but the problem returns again (after window reload I _think_).
run in the terminal: rm -rf .config/Code solved my problem. I had to reconfigure some settings in vs-code.
I could track it down to the terminal.integrated.inheritEnv option. Setting it to true solved the problem for me.
This is confusing. I have no idea why clearing that data would make a difference, ssh shouldn't depend on it. We literally just run that ssh command in a terminal.
Does the inheritEnv setting work for anyone else?
@grst thanks sir, you deserve a medal!
There is a notification which was asking me to set inheritEnv to false (I _think_ that was python extension, it detected conda environment and offered to set interitEnv to false for some reason I don't remember). I haven't had a problem since I started to ignore that notification.
@Ampretuzo, I got that same warning from python/conda.
In fact, with inheritEnv set to false, I cannot open a terminal any more at all (it stays blank).
This has already been reported in the vscode repo: https://github.com/microsoft/vscode/issues/76542, https://github.com/microsoft/vscode/issues/86699
Does anyone have any theory as to how the terminal environment is preventing ssh from connecting?
I had the same issue (2nd time) today. Reinstalling worked last time, this time did not, but cannot completely rule out vpn issues (yet)
I am having this issue as well... one thing I was able to track down was that if I set ConnectTimeout to 0 (zero) in my ~./ssh/config for my host, it works.
FWIW, if I do this: ssh -D 36887 -o ConnectTimeout=15 yourhostname bash it does NOT work either. If I change the 15 to a 0, it works.
@grist solution worked for me. That is: changing terminal.integrated.inheritEnv to true in Settings.
Here is what triggered me setting it to false in the first place:

@Grist solution worked for me. That is: changing terminal.integrated.inheritEnv to true in Settings.
This fixed it for me, too! I also unchecked it after getting the screenshotted notification in VSCode!
I also have the issue, but not the same situation on my Windows 10 as a server.
VSCode version: 1.43.0-insider (Commit: d1c48c103cabc6e729f59787c0b9c86fb3d39e73)
Remote - SSH version: 2020.3.2402 (Nightly)
Local OS version: Windows 10 1909
Remote OS version: Same as local
Default SSH console is cmd.
The machine has GnuWin32 and uname must use it. I tried uname -rsv locally and confirmed the same output as below. powershell "get-command uname" shows GnuWin32.
This is the output with trace:
[12:22:05.489] Log Level: 1
[12:22:05.513] [email protected]
[12:22:05.513] win32 x64
[12:22:05.515] SSH Resolver called for "ssh-remote+*****", attempt 1
[12:22:05.516] SSH Resolver called for host: *****
[12:22:05.516] Setting up SSH remote "*****"
[12:22:05.519] Acquiring local install lock: **********\AppData\Local\Temp\vscode-remote-ssh-*****-install.lock
[12:22:05.541] Looking for existing server data file at **********\AppData\Roaming\Code - Insiders\User\globalStorage\ms-vscode-remote.remote-ssh-nightly\vscode-ssh-host-*****-d1c48c103cabc6e729f59787c0b9c86fb3d39e73\data.json
[12:22:05.543] Using commit id "d1c48c103cabc6e729f59787c0b9c86fb3d39e73" and quality "insider" for server
[12:22:05.545] Install and start server if needed
[12:22:05.568] Checking ssh with "ssh -V"
[12:22:05.643] > OpenSSH_for_Windows_7.7p1, LibreSSL 2.6.5
[12:22:05.644] Preferring non-windows OpenSSH, skipping
[12:22:05.644] Checking ssh with "C:\WINDOWS\System32\OpenSSH\ssh.exe -V"
[12:22:05.755] > OpenSSH_for_Windows_7.7p1, LibreSSL 2.6.5
[12:22:05.755] Preferring non-windows OpenSSH, skipping
[12:22:05.756] Checking ssh with "C:\Program Files\Git\usr\bin\ssh.exe -V"
[12:22:05.927] > OpenSSH_8.1p1, OpenSSL 1.1.1d 10 Sep 2019
[12:22:05.929] Using SSH config file "**********\.ssh\config"
[12:22:05.930] askpass server listening on \\.\pipe\vscode-ssh-askpass-15db4b8e5e14f01272a31e4905f6308b0ebfbdf4-sock
[12:22:05.932] Spawning local server with {"ipcHandlePath":"\\\\.\\pipe\\vscode-ssh-askpass-28613737204f39713330f58e258ead93bca00aa7-sock","sshCommand":"C:\\Program Files\\Git\\usr\\bin\\ssh.exe","sshArgs":["-v","-T","-D","56141","-F","**********\\.ssh\\config","*****"],"dataFilePath":"**********\\AppData\\Roaming\\Code - Insiders\\User\\globalStorage\\ms-vscode-remote.remote-ssh-nightly\\vscode-ssh-host-*****-d1c48c103cabc6e729f59787c0b9c86fb3d39e73\\data.json"}
[12:22:05.932] Local server env: {"DISPLAY":"1","ELECTRON_RUN_AS_NODE":"1","SSH_ASKPASS":"**********\\.vscode-insiders\\extensions\\ms-vscode-remote.remote-ssh-nightly-2020.3.2402\\out\\local-server\\askpass.bat","VSCODE_SSH_ASKPASS_NODE":"**********\\AppData\\Local\\Programs\\Microsoft VS Code Insiders\\Code - Insiders.exe","VSCODE_SSH_ASKPASS_MAIN":"**********\\.vscode-insiders\\extensions\\ms-vscode-remote.remote-ssh-nightly-2020.3.2402\\out\\askpass-main.js","VSCODE_SSH_ASKPASS_HANDLE":"\\\\.\\pipe\\vscode-ssh-askpass-15db4b8e5e14f01272a31e4905f6308b0ebfbdf4-sock"}
[12:22:05.948] Spawned 2024
[12:22:06.077] > local-server> Spawned ssh: 39532
[12:22:06.213] stderr> OpenSSH_8.1p1, OpenSSL 1.1.1d 10 Sep 2019
[12:22:06.214] stderr> debug1: Reading configuration data **********\\.ssh\\config
[12:22:06.214] stderr> debug1: **********\\.ssh\\config line 1: Applying options for *****
[12:22:06.264] stderr> debug1: Connecting to localhost [::1] port *****.
[12:22:06.264] stderr> debug1: Connection established.
[12:22:06.267] stderr> debug1: identity file ********** type -1
[12:22:06.269] stderr> debug1: identity file ********** type -1
[12:22:06.269] stderr> debug1: Local version string SSH-2.0-OpenSSH_8.1
[12:22:06.340] stderr> debug1: Remote protocol version 2.0, remote software version OpenSSH_for_Windows_7.7
[12:22:06.340] stderr> debug1: match: OpenSSH_for_Windows_7.7 pat OpenSSH* compat 0x04000000
[12:22:06.340] stderr> debug1: Authenticating to localhost:***** as '**********'
[12:22:06.351] stderr> debug1: SSH2_MSG_KEXINIT sent
[12:22:06.399] stderr> debug1: SSH2_MSG_KEXINIT received
[12:22:06.399] stderr> debug1: kex: algorithm: **********************
[12:22:06.399] stderr> debug1: kex: host key algorithm: **********************
[12:22:06.400] stderr> debug1: kex: server->client cipher: [email protected] MAC: <implicit> compression: none
[12:22:06.400] stderr> debug1: kex: client->server cipher: [email protected] MAC: <implicit> compression: none
[12:22:06.401] stderr> debug1: expecting SSH2_MSG_KEX_ECDH_REPLY
[12:22:06.404] stderr> debug1: Server host key: ********************** SHA256:******************************************
[12:22:06.458] stderr> debug1: Host 'localhost' is known and matches the ********** host key.
[12:22:06.458] stderr> debug1: Found key in /**********/.ssh/known_hosts:1
[12:22:06.458] stderr> debug1: rekey out after 134217728 blocks
[12:22:06.458] stderr> debug1: SSH2_MSG_NEWKEYS sent
[12:22:06.458] stderr> debug1: expecting SSH2_MSG_NEWKEYS
[12:22:06.458] stderr> debug1: SSH2_MSG_NEWKEYS received
[12:22:06.458] stderr> debug1: rekey in after 134217728 blocks
[12:22:06.458] stderr> debug1: Will attempt key: **********\\.ssh\\*****_privkey explicit
[12:22:06.458] stderr> debug1: SSH2_MSG_EXT_INFO received
[12:22:06.458] stderr> debug1: kex_input_ext_info: server-sig-algs=<ssh-ed25519,ssh-rsa,rsa-sha2-256,rsa-sha2-512,ssh-dss,ecdsa-sha2-nistp256,ecdsa-sha2-nistp384,ecdsa-sha2-nistp521>
[12:22:06.458] stderr> debug1: SSH2_MSG_SERVICE_ACCEPT received
[12:22:06.458] stderr> debug1: Authentications that can continue: publickey,keyboard-interactive
[12:22:06.458] stderr> debug1: Next authentication method: publickey
[12:22:06.459] stderr> debug1: Trying private key: **********\\.ssh\\*****_privkey
[12:22:06.460] stderr> debug1: read_passphrase: can't open /dev/tty: No such device or address
[12:22:06.738] Got askpass request: {"request":"Enter passphrase for key '**********\\.ssh\\*****_privkey': "}
[12:22:06.740] Detected passphrase message
[12:22:06.745] Listening for interwindow password on \\.\pipe\vscode-ssh-askpass-87b92c8944dd0b604fac5cd2547d7ba40396178a-sock
[12:22:06.745] Writing password prompt to globalState
[12:22:13.053] Got passphrase response
[12:22:13.053] Interactor gave response: ********
[12:22:13.054] Cleaning up other-window auth server
[12:22:13.102] stderr> debug1: Authentication succeeded (publickey).
[12:22:13.102] stderr> Authenticated to localhost ([::1]:*****).
[12:22:13.102] stderr> debug1: Local connections to LOCALHOST:56141 forwarded to remote address socks:0
[12:22:13.102] stderr> debug1: Local forwarding listening on ::1 port 56141.
[12:22:13.102] stderr> debug1: channel 0: new [port listener]
[12:22:13.102] stderr> debug1: Local forwarding listening on 127.0.0.1 port 56141.
[12:22:13.102] stderr> debug1: channel 1: new [port listener]
[12:22:13.102] stderr> debug1: channel 2: new [client-session]
[12:22:13.103] stderr> debug1: Requesting [email protected]
[12:22:13.103] stderr> debug1: Entering interactive session.
[12:22:13.103] stderr> debug1: pledge: network
[12:22:13.156] stderr> debug1: client_input_global_request: rtype [email protected] want_reply 0
[12:22:13.181] > Microsoft Windows [Version 10.0.18363.657]
> (c) 2019 Microsoft Corporation. All rights reserved.
>
> **********@********** **********>echo 'ready: 8092e6e8445f'
[12:22:13.183] > 'ready: 8092e6e8445f'
>
> **********@********** **********>
[12:22:13.187] > uname -rsv
[12:22:13.243] > windows32 2.6.2 9200
[12:22:13.247] >
> **********@********** **********>
[12:22:30.055] Terminating local server
[12:22:30.061] Resolver error: Connecting with SSH timed out
[12:22:30.069] TELEMETRY: {"eventName":"resolver","properties":{"outcome":"failure","reason":"Timeout","askedPw":"0","askedPassphrase":"0","asked2fa":"0","askedHostKey":"0","gotUnrecognizedPrompt":"0","remoteInConfigFile":"1"},"measures":{"resolveAttempts":1,"retries":1}}
[12:22:30.072] ------
[12:22:30.082] Local server exit: null
Thanks @suzuryo3893, you have a different issue and I filed https://github.com/microsoft/vscode-remote-release/issues/2471
Thanks @suzuryo3893, you have a different issue and I filed #2471
@roblourens
In which version will this issue be fixed? I am currently experiencing the same problem as @suzuryo3893 , except that the remote-ssh version is 0.49.0
Still reproduced with remote-ssh version 0.49.0 and vscode version 1.42.1, Windows 10 ssh connect to Linux. But it works normal yesterday.
I fixed by using this workaround:
ps -ef| grep $USER | grep vscode | awk -F\ '{print($2)}' | xargs -i kill -9 {}data folder and bin folder under .vscode-server folder on servercd ~/.vscode-server;rm data/* -rf;rm bin/* -rfhosts works okI'm also suddenly unable to connect to an Ubuntu server from Windows, according to logs it connects to the server but then says "Terminating local server" and "Resolver error: Connecting with SSH timed out". The workarounds above don't help.
It works if I downgrade Remote-SSH to 0.49.0 but fails on 0.50.0, and (on 49) it works for some servers but not others.
VSCode version 1.44.0-insider
ssh-remote 0.50 broken for me too. 049 works
ssh-remote 0.50 broken for me too. 049 works
Same for me on macOS.
I also am unable to connect to a Linux remote using a Linux host on ssh-remote version 0.50. Downgrading to 0.49 allowed me to connect again.
Hi everyone, I am going to close this issue because it's old and has gone multiple directions and the OP said his issue has been resolved.
There are multiple open issues for new problems with 0.50, please find those issues or open new issues if you can't find one that describes your problem. A general workaround for many of them is setting "remote.SSH.useLocalServer": false. Sorry for the trouble
Most helpful comment
I could track it down to the
terminal.integrated.inheritEnvoption. Setting it totruesolved the problem for me.