VSCode Remote-SSH extension through SSH gateway? - visual-studio-code

I need to access several hosts that are behind an SSH gateway.
The way the gateway works is:
I upload my public key to a web portal
I get an FQDN and port for SSH access
My client connects with the gateway, which then connects me to the specific host I'm trying to connect to based on the port I came in on
My SSH key is never actually deployed to the remote host itself. It's held by the gateway which has its own keypair that is distributed to the remote host--I do not have access to this private key.
With default settings, here's the logs:
[07:25:44.335] Log Level: 2
[07:25:44.337] remote-ssh#0.65.7
[07:25:44.337] darwin arm64
[07:25:44.338] SSH Resolver called for "ssh-remote+HOSTNAME", attempt 1
[07:25:44.338] "remote.SSH.useLocalServer": true
[07:25:44.338] "remote.SSH.path": undefined
[07:25:44.338] "remote.SSH.configFile": undefined
[07:25:44.338] "remote.SSH.useFlock": true
[07:25:44.338] "remote.SSH.lockfilesInTmp": false
[07:25:44.338] "remote.SSH.localServerDownload": auto
[07:25:44.339] "remote.SSH.remoteServerListenOnSocket": false
[07:25:44.339] "remote.SSH.showLoginTerminal": false
[07:25:44.339] "remote.SSH.defaultExtensions": []
[07:25:44.339] "remote.SSH.loglevel": 2
[07:25:44.339] SSH Resolver called for host: HOSTNAME
[07:25:44.339] Setting up SSH remote "HOSTNAME"
[07:25:44.341] Acquiring local install lock: /var/folders/_9/vfmchjgd5gl2q6s8p3y1pmg80000gn/T/vscode-remote-ssh-HOSTNAME-install.lock
[07:25:44.349] Looking for existing server data file at /Users/josh/Library/Application Support/Code/User/globalStorage/ms-vscode-remote.remote-ssh/vscode-ssh-host-HOSTNAME-379476f0e13988d90fab105c5c19e7abc8b1dea8-0.65.7/data.json
[07:25:44.349] Using commit id "379476f0e13988d90fab105c5c19e7abc8b1dea8" and quality "stable" for server
[07:25:44.351] Install and start server if needed
[07:25:44.354] PATH: /opt/homebrew/bin:/opt/homebrew/sbin:/opt/homebrew/bin:/opt/homebrew/sbin:/usr/local/bin:/usr/bin:/bin:/usr/sbin:/sbin:/Applications/Wireshark.app/Contents/MacOS
[07:25:44.354] Checking ssh with "ssh -V"
[07:25:44.358] > OpenSSH_8.1p1, LibreSSL 2.7.3
[07:25:44.359] askpass server listening on /var/folders/_9/vfmchjgd5gl2q6s8p3y1pmg80000gn/T/vscode-ssh-askpass-a4f2481dc32265d4aa0d1997d55a93523914f69d.sock
[07:25:44.360] Spawning local server with {"serverId":1,"ipcHandlePath":"/var/folders/_9/vfmchjgd5gl2q6s8p3y1pmg80000gn/T/vscode-ssh-askpass-04d1b772731e5c58d6a1e3212e8ab358ab99d39c.sock","sshCommand":"ssh","sshArgs":["-v","-T","-D","52496","-o","ConnectTimeout=15","HOSTNAME","bash"],"dataFilePath":"/Users/josh/Library/Application Support/Code/User/globalStorage/ms-vscode-remote.remote-ssh/vscode-ssh-host-HOSTNAME-379476f0e13988d90fab105c5c19e7abc8b1dea8-0.65.7/data.json"}
[07:25:44.360] Local server env: {"DISPLAY":"1","ELECTRON_RUN_AS_NODE":"1","SSH_ASKPASS":"/Users/josh/.vscode/extensions/ms-vscode-remote.remote-ssh-0.65.7/out/local-server/askpass.sh","VSCODE_SSH_ASKPASS_NODE":"/Applications/Visual Studio Code.app/Contents/Frameworks/Code Helper (Renderer).app/Contents/MacOS/Code Helper (Renderer)","VSCODE_SSH_ASKPASS_MAIN":"/Users/josh/.vscode/extensions/ms-vscode-remote.remote-ssh-0.65.7/out/askpass-main.js","VSCODE_SSH_ASKPASS_HANDLE":"/var/folders/_9/vfmchjgd5gl2q6s8p3y1pmg80000gn/T/vscode-ssh-askpass-a4f2481dc32265d4aa0d1997d55a93523914f69d.sock"}
[07:25:44.360] Spawned 6028
[07:25:44.411] > local-server-1> Spawned ssh, pid=6034
[07:25:44.413] stderr> OpenSSH_8.1p1, LibreSSL 2.7.3
[07:25:44.615] stderr> debug1: Server host key: ssh-rsa SHA256:uvobnEougyevd5GyZzHzqTJ2C/vx2RgT1agdqvlXZRc
[07:25:44.743] stderr> This is a private system; unauthorized access is prohibited. Disconnect immediately if you have not been explicitly authorized to access this system.
[07:25:45.714] stderr> Authenticated to 54.189.187.155 ([54.189.187.155]:47000).
[07:25:46.440] > ready: 9df4e9b85f9c
[07:25:46.496] > Linux 5.3.0-1017-aws #18~18.04.1-Ubuntu SMP Wed Apr 8 15:12:16 UTC 2020
[07:25:46.496] Platform: linux
[07:25:46.564] > 9df4e9b85f9c: running
> Acquiring lock on /home/ubuntu/.vscode-server/bin/379476f0e13988d90fab105c5c19e7abc8b1dea8/vscode-remote-lock.ubuntu.379476f0e13988d90fab105c5c19e7abc8b1dea8
[07:25:46.588] > Installing to /home/ubuntu/.vscode-server/bin/379476f0e13988d90fab105c5c19e7abc8b1dea8...
> 9df4e9b85f9c%%1%%
> Downloading with wget
[07:25:48.464] > Download complete
> 9df4e9b85f9c%%2%%
> tar --version:
> tar (GNU tar) 1.29
> Copyright (C) 2015 Free Software Foundation, Inc.
> License GPLv3+: GNU GPL version 3 or later <http://gnu.org/licenses/gpl.html>.
> This is free software: you are free to change and redistribute it.
> There is NO WARRANTY, to the extent permitted by law.
>
> Written by John Gilmore and Jay Fenlason.
[07:25:49.883] > Checking /home/ubuntu/.vscode-server/.379476f0e13988d90fab105c5c19e7abc8b1dea8.log and /home/ubuntu/.vscode-server/.379476f0e13988d90fab105c5c19e7abc8b1dea8.pid for a running server
> WARNING: VS Code Server is running but its logfile is missing. Don't delete the VS Code Server manually, run the command 'Uninstall VS Code Server'.
> Starting server with command... /home/ubuntu/.vscode-server/bin/379476f0e13988d90fab105c5c19e7abc8b1dea8/server.sh --start-server --host=127.0.0.1 --enable-remote-auto-shutdown --port=0 &> "/home/ubuntu/.vscode-server/.379476f0e13988d90fab105c5c19e7abc8b1dea8.log" < /dev/null
> printenv:
> SSH_CONNECTION=10.1.1.254 45382 10.1.1.4 22
> LANG=C.UTF-8
> XDG_SESSION_ID=74
> USER=ubuntu
> PWD=/home/ubuntu
> HOME=/home/ubuntu
> SSH_CLIENT=10.1.1.254 45382 22
> MAIL=/var/mail/ubuntu
> SHELL=/bin/bash
> SHLVL=3
> VSCODE_AGENT_FOLDER=/home/ubuntu/.vscode-server
> LOGNAME=ubuntu
> XDG_RUNTIME_DIR=/run/user/1000
> PATH=/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/games:/usr/local/games
> _=/usr/bin/printenv
> OLDPWD=/home/ubuntu/.vscode-server/bin/379476f0e13988d90fab105c5c19e7abc8b1dea8
> Spawned remote server: 19082
[07:25:49.917] > Waiting for server log...
[07:25:49.941] > Waiting for server log...
[07:25:49.989] >
> *
> * Reminder: You may only use this software with Visual Studio family products,
> * as described in the license (https://go.microsoft.com/fwlink/?linkid=2077057)
> *
>
> Checking server status on port 43643 with wget
[07:25:50.158] > 9df4e9b85f9c: start
> SSH_AUTH_SOCK====
> DISPLAY====
> webUiAccessToken====
> listeningOn==43643==
> osReleaseId==ubuntu==
> arch==x86_64==
> tmpDir==/run/user/1000==
> platform==linux==
> unpackResult==success==
> didLocalDownload==0==
> downloadTime==1868==
> installTime==1402==
> extInstallTime====
> serverStartTime==88==
> connectionToken==1111aaa1-11a1-111a-11a1-1a111a111a11==
> 9df4e9b85f9c: end
[07:25:50.158] Received install output:
SSH_AUTH_SOCK====
DISPLAY====
webUiAccessToken====
listeningOn==43643==
osReleaseId==ubuntu==
arch==x86_64==
tmpDir==/run/user/1000==
platform==linux==
unpackResult==success==
didLocalDownload==0==
downloadTime==1868==
installTime==1402==
extInstallTime====
serverStartTime==88==
connectionToken==1111aaa1-11a1-111a-11a1-1a111a111a11==
[07:25:50.159] Remote server is listening on 43643
[07:25:50.159] Parsed server configuration: {"serverConfiguration":{"remoteListeningOn":{"port":43643},"osReleaseId":"ubuntu","arch":"x86_64","webUiAccessToken":"","sshAuthSock":"","display":"","tmpDir":"/run/user/1000","platform":"linux","connectionToken":"1111aaa1-11a1-111a-11a1-1a111a111a11"},"downloadTime":1868,"installTime":1402,"serverStartTime":88,"installUnpackCode":"success"}
[07:25:50.160] Persisting server connection details to /Users/josh/Library/Application Support/Code/User/globalStorage/ms-vscode-remote.remote-ssh/vscode-ssh-host-HOSTNAME-379476f0e13988d90fab105c5c19e7abc8b1dea8-0.65.7/data.json
[07:25:50.162] Starting forwarding server. localPort 52500 -> socksPort 52496 -> remotePort 43643
[07:25:50.162] Forwarding server listening on 52500
[07:25:50.163] Waiting for ssh tunnel to be ready
[07:25:50.164] Tunneled 43643 to local port 52500
[07:25:50.164] Resolved "ssh-remote+HOSTNAME" to "127.0.0.1:52500"
[07:25:50.165] [Forwarding server 52500] Got connection 0
[07:25:50.171] ------
[07:25:50.198] [Forwarding server 52500] Got connection 1
[07:25:50.220] Failed to set up socket for dynamic port forward to remote port 43643: Socket closed. Is the remote port correct?
[07:25:50.245] Failed to set up socket for dynamic port forward to remote port 43643: Socket closed. Is the remote port correct?
I ran "rm -rf ~/.vscode-server", then I then followed the instructions under "Connecting to systems that dynamically assign machines per connection" on this page: https://code.visualstudio.com/docs/remote/troubleshooting
Here's my ~/.ssh/config:
Host ubuntu
HostName <HOSTNAME>
Port 47000
ControlMaster auto
ControlPath ~/.ssh/sockets/%r#%h:%p
ControlPersist 600
And here's the remote server's sshd_config (I'm using a Mac so ControlMaster should work):
# $OpenBSD: sshd_config,v 1.101 2017/03/14 07:19:07 djm Exp $
# This is the sshd server system-wide configuration file. See
# sshd_config(5) for more information.
# This sshd was compiled with PATH=/usr/bin:/bin:/usr/sbin:/sbin
# The strategy used for options in the default sshd_config shipped with
# OpenSSH is to specify options with their default value where
# possible, but leave them commented. Uncommented options override the
# default value.
#Port 22
#AddressFamily any
#ListenAddress 0.0.0.0
#ListenAddress ::
#HostKey /etc/ssh/ssh_host_rsa_key
#HostKey /etc/ssh/ssh_host_ecdsa_key
#HostKey /etc/ssh/ssh_host_ed25519_key
# Ciphers and keying
#RekeyLimit default none
# Logging
#SyslogFacility AUTH
#LogLevel INFO
# Authentication:
#LoginGraceTime 2m
#PermitRootLogin prohibit-password
#StrictModes yes
#MaxAuthTries 6
#MaxSessions 10
#PubkeyAuthentication yes
# Expect .ssh/authorized_keys2 to be disregarded by default in future.
#AuthorizedKeysFile .ssh/authorized_keys .ssh/authorized_keys2
#AuthorizedPrincipalsFile none
#AuthorizedKeysCommand none
#AuthorizedKeysCommandUser nobody
# For this to work you will also need host keys in /etc/ssh/ssh_known_hosts
#HostbasedAuthentication no
# Change to yes if you don't trust ~/.ssh/known_hosts for
# HostbasedAuthentication
#IgnoreUserKnownHosts no
# Don't read the user's ~/.rhosts and ~/.shosts files
#IgnoreRhosts yes
# To disable tunneled clear text passwords, change to no here!
PasswordAuthentication no
#PermitEmptyPasswords no
# Change to yes to enable challenge-response passwords (beware issues with
# some PAM modules and threads)
ChallengeResponseAuthentication no
# Kerberos options
#KerberosAuthentication no
#KerberosOrLocalPasswd yes
#KerberosTicketCleanup yes
#KerberosGetAFSToken no
# GSSAPI options
#GSSAPIAuthentication no
#GSSAPICleanupCredentials yes
#GSSAPIStrictAcceptorCheck yes
#GSSAPIKeyExchange no
# Set this to 'yes' to enable PAM authentication, account processing,
# and session processing. If this is enabled, PAM authentication will
# be allowed through the ChallengeResponseAuthentication and
# PasswordAuthentication. Depending on your PAM configuration,
# PAM authentication via ChallengeResponseAuthentication may bypass
# the setting of "PermitRootLogin without-password".
# If you just want the PAM account and session checks to run without
# PAM authentication, then enable this but set PasswordAuthentication
# and ChallengeResponseAuthentication to 'no'.
UsePAM yes
AllowStreamLocalForwarding yes
#AllowAgentForwarding yes
AllowTcpForwarding yes
#GatewayPorts no
X11Forwarding yes
#X11DisplayOffset 10
#X11UseLocalhost yes
#PermitTTY yes
PrintMotd no
#PrintLastLog yes
#TCPKeepAlive yes
#UseLogin no
#PermitUserEnvironment no
#Compression delayed
#ClientAliveInterval 0
#ClientAliveCountMax 3
#UseDNS no
#PidFile /var/run/sshd.pid
#MaxStartups 10:30:100
#PermitTunnel no
#ChrootDirectory none
#VersionAddendum none
# no default banner path
#Banner none
# Allow client to pass locale environment variables
AcceptEnv LANG LC_*
# override default of no subsystems
Subsystem sftp /usr/lib/openssh/sftp-server
# Example of overriding settings on a per-user basis
#Match User anoncvs
# X11Forwarding no
# AllowTcpForwarding no
# PermitTTY no
# ForceCommand cvs server
After attempting to reconnect, these are the logs:
[07:35:52.712] Log Level: 2
[07:35:52.714] remote-ssh#0.65.7
[07:35:52.714] darwin arm64
[07:35:52.715] SSH Resolver called for "ssh-remote+ubuntu", attempt 1
[07:35:52.715] "remote.SSH.useLocalServer": true
[07:35:52.715] "remote.SSH.path": undefined
[07:35:52.715] "remote.SSH.configFile": undefined
[07:35:52.715] "remote.SSH.useFlock": true
[07:35:52.715] "remote.SSH.lockfilesInTmp": false
[07:35:52.715] "remote.SSH.localServerDownload": auto
[07:35:52.715] "remote.SSH.remoteServerListenOnSocket": false
[07:35:52.716] "remote.SSH.showLoginTerminal": false
[07:35:52.716] "remote.SSH.defaultExtensions": []
[07:35:52.716] "remote.SSH.loglevel": 2
[07:35:52.716] SSH Resolver called for host: ubuntu
[07:35:52.716] Setting up SSH remote "ubuntu"
[07:35:52.717] Acquiring local install lock: /var/folders/_9/vfmchjgd5gl2q6s8p3y1pmg80000gn/T/vscode-remote-ssh-ubuntu-install.lock
[07:35:52.726] Looking for existing server data file at /Users/josh/Library/Application Support/Code/User/globalStorage/ms-vscode-remote.remote-ssh/vscode-ssh-host-ubuntu-379476f0e13988d90fab105c5c19e7abc8b1dea8-0.65.7/data.json
[07:35:52.726] Using commit id "379476f0e13988d90fab105c5c19e7abc8b1dea8" and quality "stable" for server
[07:35:52.728] Install and start server if needed
[07:35:52.730] PATH: /opt/homebrew/bin:/opt/homebrew/sbin:/opt/homebrew/bin:/opt/homebrew/sbin:/usr/local/bin:/usr/bin:/bin:/usr/sbin:/sbin:/Applications/Wireshark.app/Contents/MacOS
[07:35:52.730] Checking ssh with "ssh -V"
[07:35:52.733] > OpenSSH_8.1p1, LibreSSL 2.7.3
[07:35:52.734] askpass server listening on /var/folders/_9/vfmchjgd5gl2q6s8p3y1pmg80000gn/T/vscode-ssh-askpass-53beece063b2e0e2b4c364baee37f2170d54995c.sock
[07:35:52.735] Spawning local server with {"serverId":1,"ipcHandlePath":"/var/folders/_9/vfmchjgd5gl2q6s8p3y1pmg80000gn/T/vscode-ssh-askpass-ef52c1a9145be571fa987d52436563f7df923b30.sock","sshCommand":"ssh","sshArgs":["-v","-T","-D","52611","-o","ConnectTimeout=15","ubuntu"],"dataFilePath":"/Users/josh/Library/Application Support/Code/User/globalStorage/ms-vscode-remote.remote-ssh/vscode-ssh-host-ubuntu-379476f0e13988d90fab105c5c19e7abc8b1dea8-0.65.7/data.json"}
[07:35:52.735] Local server env: {"DISPLAY":"1","ELECTRON_RUN_AS_NODE":"1","SSH_ASKPASS":"/Users/josh/.vscode/extensions/ms-vscode-remote.remote-ssh-0.65.7/out/local-server/askpass.sh","VSCODE_SSH_ASKPASS_NODE":"/Applications/Visual Studio Code.app/Contents/Frameworks/Code Helper (Renderer).app/Contents/MacOS/Code Helper (Renderer)","VSCODE_SSH_ASKPASS_MAIN":"/Users/josh/.vscode/extensions/ms-vscode-remote.remote-ssh-0.65.7/out/askpass-main.js","VSCODE_SSH_ASKPASS_HANDLE":"/var/folders/_9/vfmchjgd5gl2q6s8p3y1pmg80000gn/T/vscode-ssh-askpass-53beece063b2e0e2b4c364baee37f2170d54995c.sock"}
[07:35:52.735] Spawned 6261
[07:35:52.786] > local-server-1> Spawned ssh, pid=6267
[07:35:52.788] stderr> OpenSSH_8.1p1, LibreSSL 2.7.3
[07:35:52.973] stderr> debug1: Server host key: ssh-rsa SHA256:uvobnEougyevd5GyZzHzqTJ2C/vx2RgT1agdqvlXZRc
[07:35:53.108] stderr> This is a private system; unauthorized access is prohibited. Disconnect immediately if you have not been explicitly authorized to access this system.
[07:35:53.879] stderr> Authenticated to HOSTNAME ([HOSTNAME]:47000).
[07:35:54.565] > -- UDF SSH ---------------------
> Deployment: f5 CIS for k8s w calico (w lab guide)
> Component: kube-master
> --------------------------------
> Welcome to Ubuntu 18.04.4 LTS (GNU/Linux 5.3.0-1017-aws x86_64)
>
> * Documentation: https://help.ubuntu.com
> * Management: https://landscape.canonical.com
> * Support: https://ubuntu.com/advantage
>
> System information as of Wed Aug 11 14:35:54 UTC 2021
>
> System load: 0.16 IP address for eth0: 10.1.1.4
> Usage of /: 31.3% of 19.32GB IP address for eth1: 10.1.20.20
> Memory usage: 17% IP address for docker0: 172.17.0.1
> Swap usage: 0% IP address for tunl0: 192.168.106.0
> Processes: 232 IP address for tailscale0: 100.71.141.61
> Users logged in: 1
>
> * Super-optimized for small spaces - read how we shrank the memory
> footprint of MicroK8s to make it the smallest full K8s around.
>
> https://ubuntu.com/blog/microk8s-memory-optimisation
>
> Get cloud support with Ubuntu Advantage Cloud Guest:
> http://www.ubuntu.com/business/services/cloud
>
> * Canonical Livepatch is available for installation.
> - Reduce system reboots and improve kernel security. Activate at:
> https://ubuntu.com/livepatch
>
> 187 packages can be updated.
> 135 updates are security updates.
>
> New release '20.04.2 LTS' available.
> Run 'do-release-upgrade' to upgrade to it.
>
>
> Last login: Wed Aug 11 14:24:27 2021 from 10.1.1.254
[07:35:54.588] > echo 'ready: c81f6e315e44'
[07:35:54.613] > ubuntu#ip-10-1-1-4:~$ echo 'ready: c81f6e315e44'
> ready: c81f6e315e44
> ubuntu#ip-10-1-1-4:~$
[07:35:54.638] > uname -rsv
> Linux 5.3.0-1017-aws #18~18.04.1-Ubuntu SMP Wed Apr 8 15:12:16 UTC 2020
> ubuntu#ip-10-1-1-4:~$
[07:35:54.638] Platform: linux
[07:35:54.690] > bash
> ubuntu#ip-10-1-1-4:~$
[07:35:54.691] > function mainScriptWrapper {
> >
> > echo "c81f6e315e44: running"
> >
> v> #
> > # Setup
> sion"
> f> #
> > VSC_TMP="${XDG_RUNTIME_DIR:-`echo /tmp`}"
> > COMMIT_ID="379476f0e13988d90fab105c5c19e7abc8b1dea8"
> > EXTENSIONS=""
> > TELEMETRY=""
> > export VSCODE_AGENT_FOLDER=$HOME/.vscode-server
> >
[07:35:54.694] > ALLOW_CLIENT_DOWNLOAD="1"
> > FORCE_CLIENT_DOWNLOAD="0"
> > now=`date +%s`
> > SERVER_LISTEN_FLAG=--port=0
> > UNPACK_RESULT=
> > DID_LOCAL_DOWNLOAD=0
> > DOWNLOAD_TIME=
> ed > INSTALL_TIME=
> > EXT_INSTALL_TIME=
> icen> SERVER_START_TIME=
> > CONNECTION_TOKEN=
[07:35:54.713] > >
> > VSCH_DIR="$VSCODE_AGENT_FOLDER/bin/$COMMIT_ID"
> > VSCH_LOGFILE="$VSCODE_AGENT_FOLDER/.$COMMIT_ID.log"
> > VSCH_PIDFILE="$VSCODE_AGENT_FOLDER/.$COMMIT_ID.pid"
> > VSCH_TOKENFILE="$VSCODE_AGENT_FOLDER/.$COMMIT_ID.token"
> >
> > fail_with_exitcode() {
>
> fi
> >
[07:35:54.736] > echo "c81f6e315e44: start"
> > echo "exitCode==$1=="
> >
[07:35:54.761] > echo_common_results
> [[>
[07:35:54.785] > echo "c81f6e315e44: end"
> >
[07:35:54.786] Received install output: "
> echo "exitCode==$1=="
> echo_common_results
[[> echo "
[07:35:54.788] Failed to parse remote port from server output
[07:35:54.789] Terminating local server
[07:35:54.791] Resolver error: Error:
at Function.Create (/Users/josh/.vscode/extensions/ms-vscode-remote.remote-ssh-0.65.7/out/extension.js:1:64597)
at Object.t.handleInstallOutput (/Users/josh/.vscode/extensions/ms-vscode-remote.remote-ssh-0.65.7/out/extension.js:1:63240)
at Object.e [as tryInstallWithLocalServer] (/Users/josh/.vscode/extensions/ms-vscode-remote.remote-ssh-0.65.7/out/extension.js:1:387511)
at processTicksAndRejections (internal/process/task_queues.js:93:5)
at async /Users/josh/.vscode/extensions/ms-vscode-remote.remote-ssh-0.65.7/out/extension.js:1:294411
at async Object.t.withShowDetailsEvent (/Users/josh/.vscode/extensions/ms-vscode-remote.remote-ssh-0.65.7/out/extension.js:1:406401)
at async /Users/josh/.vscode/extensions/ms-vscode-remote.remote-ssh-0.65.7/out/extension.js:1:386050
at async E (/Users/josh/.vscode/extensions/ms-vscode-remote.remote-ssh-0.65.7/out/extension.js:1:382648)
at async Object.t.resolveWithLocalServer (/Users/josh/.vscode/extensions/ms-vscode-remote.remote-ssh-0.65.7/out/extension.js:1:385666)
at async Object.t.resolve (/Users/josh/.vscode/extensions/ms-vscode-remote.remote-ssh-0.65.7/out/extension.js:1:295808)
at async /Users/josh/.vscode/extensions/ms-vscode-remote.remote-ssh-0.65.7/out/extension.js:127:110656
[07:35:54.798] ------
The final thing I attempted was setting "remote.SSH.remoteServerListenOnSocket": true in the VScode Remote SSH settings. I also already had "AllowStreamLocalForwarding yes" in the sshd_config.
[07:40:37.993] Log Level: 2
[07:40:37.994] remote-ssh#0.65.7
[07:40:37.995] darwin arm64
[07:40:37.995] SSH Resolver called for "ssh-remote+ubuntu", attempt 1
[07:40:37.995] "remote.SSH.useLocalServer": false
[07:40:37.995] "remote.SSH.showLoginTerminal": false
[07:40:37.996] "remote.SSH.remotePlatform": {"10.10.20.201":"macOS","100.127.23.80":"linux","4b7cb23c-b5a6-4459-b9e7-940a9c7fe875.access.udf.f5.com":"linux","ds918":"linux"}
[07:40:37.996] "remote.SSH.path": undefined
[07:40:37.996] "remote.SSH.configFile": undefined
[07:40:37.996] "remote.SSH.useFlock": true
[07:40:37.996] "remote.SSH.lockfilesInTmp": false
[07:40:37.996] "remote.SSH.localServerDownload": auto
[07:40:37.996] "remote.SSH.remoteServerListenOnSocket": true
[07:40:37.996] "remote.SSH.showLoginTerminal": false
[07:40:37.996] "remote.SSH.defaultExtensions": []
[07:40:37.996] "remote.SSH.loglevel": 2
[07:40:37.996] SSH Resolver called for host: ubuntu
[07:40:37.996] Setting up SSH remote "ubuntu"
[07:40:38.005] Using commit id "379476f0e13988d90fab105c5c19e7abc8b1dea8" and quality "stable" for server
[07:40:38.007] Install and start server if needed
[07:40:39.167] PATH: /opt/homebrew/bin:/opt/homebrew/sbin:/opt/homebrew/bin:/opt/homebrew/sbin:/usr/local/bin:/usr/bin:/bin:/usr/sbin:/sbin:/Applications/Wireshark.app/Contents/MacOS
[07:40:39.167] Checking ssh with "ssh -V"
[07:40:39.171] > OpenSSH_8.1p1, LibreSSL 2.7.3
[07:40:39.173] Running script with connection command: ssh -T -D 52660 -o ConnectTimeout=15 ubuntu bash
[07:40:40.134] > 786dc09e271f: running
> Acquiring lock on /home/ubuntu/.vscode-server/bin/379476f0e13988d90fab105c5c19e7abc8b1dea8/vscode-remote-lock.ubuntu.379476f0e13988d90fab105c5c19e7abc8b1dea8
> Installing to /home/ubuntu/.vscode-server/bin/379476f0e13988d90fab105c5c19e7abc8b1dea8...
> 786dc09e271f%%1%%
> Downloading with wget
[07:40:40.135] Got some output, clearing connection timeout
[07:40:42.399] > Download complete
> 786dc09e271f%%2%%
> tar --version:
> tar (GNU tar) 1.29
> Copyright (C) 2015 Free Software Foundation, Inc.
> License GPLv3+: GNU GPL version 3 or later <http://gnu.org/licenses/gpl.html>.
> This is free software: you are free to change and redistribute it.
> There is NO WARRANTY, to the extent permitted by law.
>
> Written by John Gilmore and Jay Fenlason.
[07:40:43.749] > Checking /home/ubuntu/.vscode-server/.379476f0e13988d90fab105c5c19e7abc8b1dea8.log and /home/ubuntu/.vscode-server/.379476f0e13988d90fab105c5c19e7abc8b1dea8.pid for a running server
> WARNING: VS Code Server is running but its logfile is missing. Don't delete the VS Code Server manually, run the command 'Uninstall VS Code Server'.
> Starting server with command... /home/ubuntu/.vscode-server/bin/379476f0e13988d90fab105c5c19e7abc8b1dea8/server.sh --start-server --host=127.0.0.1 --enable-remote-auto-shutdown --socket-path=/run/user/1000/vscode-ssh-remote-server-sock-1628692840 &> "/home/ubuntu/.vscode-server/.379476f0e13988d90fab105c5c19e7abc8b1dea8.log" < /dev/null
> printenv:
> SSH_CONNECTION=10.1.1.254 10190 10.1.1.4 22
> LANG=C.UTF-8
> XDG_SESSION_ID=76
> USER=ubuntu
> PWD=/home/ubuntu
> HOME=/home/ubuntu
> SSH_CLIENT=10.1.1.254 10190 22
> MAIL=/var/mail/ubuntu
> SHELL=/bin/bash
> SHLVL=2
> VSCODE_AGENT_FOLDER=/home/ubuntu/.vscode-server
> LOGNAME=ubuntu
> XDG_RUNTIME_DIR=/run/user/1000
> PATH=/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/games:/usr/local/games
> _=/usr/bin/printenv
> OLDPWD=/home/ubuntu/.vscode-server/bin/379476f0e13988d90fab105c5c19e7abc8b1dea8
> Spawned remote server: 4972
[07:40:43.773] > Waiting for server log...
[07:40:43.798] > Waiting for server log...
[07:40:43.860] >
> *
> * Reminder: You may only use this software with Visual Studio family products,
> * as described in the license (https://go.microsoft.com/fwlink/?linkid=2077057)
> *
>
> Checking server status on socket /run/user/1000/vscode-ssh-remote-server-sock-1628692840 with curl
[07:40:44.016] > 786dc09e271f: start
> SSH_AUTH_SOCK====
> DISPLAY====
> webUiAccessToken====
> listeningOn==/run/user/1000/vscode-ssh-remote-server-sock-1628692840==
> osReleaseId==ubuntu==
> arch==x86_64==
> tmpDir==/run/user/1000==
> platform==linux==
> unpackResult==success==
> didLocalDownload==0==
> downloadTime==2266==
> installTime==1329==
> extInstallTime====
> serverStartTime==84==
> connectionToken==111a1111-a111-1a11-1111-11111aaa111a==
> 786dc09e271f: end
[07:40:44.016] Received install output:
SSH_AUTH_SOCK====
DISPLAY====
webUiAccessToken====
listeningOn==/run/user/1000/vscode-ssh-remote-server-sock-1628692840==
osReleaseId==ubuntu==
arch==x86_64==
tmpDir==/run/user/1000==
platform==linux==
unpackResult==success==
didLocalDownload==0==
downloadTime==2266==
installTime==1329==
extInstallTime====
serverStartTime==84==
connectionToken==111a1111-a111-1a11-1111-11111aaa111a==
[07:40:44.018] Remote server is listening on /run/user/1000/vscode-ssh-remote-server-sock-1628692840
[07:40:44.018] Parsed server configuration: {"serverConfiguration":{"remoteListeningOn":{"socketPath":"/run/user/1000/vscode-ssh-remote-server-sock-1628692840"},"osReleaseId":"ubuntu","arch":"x86_64","webUiAccessToken":"","sshAuthSock":"","display":"","tmpDir":"/run/user/1000","platform":"linux","connectionToken":"111a1111-a111-1a11-1111-11111aaa111a"},"downloadTime":2266,"installTime":1329,"serverStartTime":84,"installUnpackCode":"success"}
[07:40:44.022] Running script with connection command: ssh -T -L 127.0.0.1:52664:/run/user/1000/vscode-ssh-remote-server-sock-1628692840 -o ConnectTimeout=15 ubuntu bash
[07:40:44.022] Spawning tunnel with: ssh -T -L 127.0.0.1:52664:/run/user/1000/vscode-ssh-remote-server-sock-1628692840 -o ConnectTimeout=15 ubuntu bash << 'EOSSH'
echo SSH_AUTH_SOCK=$SSH_AUTH_SOCK && echo -e 'Connected to SSH Host - Please do not close this terminal' && while true; do sleep 180; echo -n ' '; done
EOSSH
[07:40:44.925] > SSH_AUTH_SOCK=
> Connected to SSH Host - Please do not close this terminal
[07:40:44.925] Spawned SSH tunnel between local port 52664 and remote target /run/user/1000/vscode-ssh-remote-server-sock-1628692840
[07:40:44.926] Waiting for ssh tunnel to be ready
[07:40:44.928] Tunneled /run/user/1000/vscode-ssh-remote-server-sock-1628692840 to local port 52664
[07:40:44.928] Resolved "ssh-remote+ubuntu" to "127.0.0.1:52664"
[07:40:44.935] ------
I didn't see any errors in the above and the status bar in VScode says I'm connected. But I can't open a terminal window nor open any folders on the remote host. I got these toast notifications:
Could not fetch remote environment
Failed to connect to the remote extension host server (Error: WebSocket close with status code 1006)
Anything else I haven't tried that I should? Is there a way I can get more verbose logs here in case this info isn't enough to determine what the problem is?

Related

VSCode SSH to remote - node: not found

SSH from VSCode (Mac) to a remote host (Raspberry Pi) stopped working a while ago.
I have searched the web for solutions, but whatever I did - I was unable to solve the issue.
I tried rm -rf ~/.vscode-server and then connect again - It did not work.
Also, I tried setting "remote.SSH.useLocalServer": false which also did not help.
Another thing I've tried is to install an older version of the SSH extension in VSCode - it did not help.
Not sure if related, but I have Fig (https://fig.io/) installed on my Mac.
Here's the log from VSCode:
> Server did not start successfully. Full server log at /home/pi/.vscode-server/.8dfae7a5cd50421d10cd99cb873990460525a898.log >>>
> /home/pi/.vscode-server/bin/8dfae7a5cd50421d10cd99cb873990460525a898/bin/code-server: 12: /home/pi/.vscode-server/bin/8dfae7a5cd50421d10cd99cb873990460525a898/bin/code-server: /home/pi/.vscode-server/bin/8dfae7a5cd50421d10cd99cb873990460525a898/node: not found
> <<< End of server log
> 911ac96db1fc: start
> exitCode==32==
> listeningOn====
> osReleaseId==raspbian==
> arch==aarch64==
> tmpDir==/run/user/1000==
> platform==linux==
> unpackResult==success==
> didLocalDownload==0==
> downloadTime==5371==
> installTime==3172==
> extInstallTime====
> serverStartTime==7728==
> 911ac96db1fc: end
[09:55:56.941] Received install output:
exitCode==32==
listeningOn====
osReleaseId==raspbian==
arch==aarch64==
tmpDir==/run/user/1000==
platform==linux==
unpackResult==success==
didLocalDownload==0==
downloadTime==5371==
installTime==3172==
extInstallTime====
serverStartTime==7728==
Checking the log I see "node: not found", so I checked the directory and confirmed that indeed the file exists there.
Can someone please assist with troubleshooting steps for this?
Thanks ahead.
EDIT: I was able to solve that following https://github.com/microsoft/vscode-remote-release/issues/6388#issuecomment-1050923254 which mentioned to change the arm_64bit to 0.
Hope that helps whoever might encounter this.

ssh works on putty and terminal but not vscode Remote ssh (Error: connection could not be established)

I recently came across this issue with the Vscode remote ssh extension. Everything was working fine but ssh suddenly has issues (connection could not be established, connection timed out, Permission Denied(public key, password))
Running ssh on terminal or Putty works fine so I'm at a loss as to what the issue is.
My Vscode version:
Version: 1.66.1 (user setup)
Commit: 8dfae7a5cd50421d10cd99cb873990460525a898
Date: 2022-04-06T14:50:12.141Z
Electron: 17.2.0
Chromium: 98.0.4758.109
Node.js: 16.13.0
V8: 9.8.177.11-electron.0
OS: Windows_NT x64 10.0.19044
My current node version
node 16.4.2
npm 8.5.0
My guess is that it might be due to node.js as I had recently used NVM to downgrade to a lower version but it was still able to work a day after installing a different version of node.js. I tried to install the latest version but the issue persists. Other things I have done:
Changing versions of Remote ssh
Reinstalling vscode
deleting the ssh config files
If nobody is able to solve this specific issue, do recommend a different IDE that can edit files from ssh. Would like to still complete my work with some kind of GUI but I'm also not sure what exactly to search for.
Here is the output log when I try to ssh. I have redacted some names.
[11:17:42.388] Log Level: 2
[11:17:42.390] remote-ssh#0.78.0
[11:17:42.390] win32 x64
[11:17:42.406] SSH Resolver called for "ssh-remote+sunfire", attempt 1
[11:17:42.407] "remote.SSH.useLocalServer": false
[11:17:42.408] "remote.SSH.showLoginTerminal": false
[11:17:42.408] "remote.SSH.remotePlatform": {"xxx.xxx.xxx.xxx.xxx":"linux","xxx":"linux"}
[11:17:42.409] "remote.SSH.path": undefined
[11:17:42.409] "remote.SSH.configFile": undefined
[11:17:42.409] "remote.SSH.useFlock": true
[11:17:42.409] "remote.SSH.lockfilesInTmp": false
[11:17:42.409] "remote.SSH.localServerDownload": auto
[11:17:42.410] "remote.SSH.remoteServerListenOnSocket": false
[11:17:42.410] "remote.SSH.showLoginTerminal": false
[11:17:42.410] "remote.SSH.defaultExtensions": []
[11:17:42.410] "remote.SSH.loglevel": 2
[11:17:42.411] "remote.SSH.enableDynamicForwarding": true
[11:17:42.411] "remote.SSH.enableRemoteCommand": false
[11:17:42.411] "remote.SSH.serverPickPortsFromRange": {}
[11:17:42.412] "remote.SSH.serverInstallPath": {}
[11:17:42.446] SSH Resolver called for host: sunfire
[11:17:42.447] Setting up SSH remote "sunfire"
[11:17:42.509] Using commit id "8dfae7a5cd50421d10cd99cb873990460525a898" and quality "stable" for server
[11:17:42.515] Install and start server if needed
[11:18:36.858] Checking ssh with "ssh -V"
[11:18:36.925] > OpenSSH_for_Windows_8.1p1, LibreSSL 3.0.2
[11:18:36.933] Running script with connection command: ssh -T -D 49776 sunfire bash
[11:18:36.939] Terminal shell path: C:\Windows\System32\cmd.exe
[11:18:37.299] > ]0;C:\Windows\System32\cmd.exe
[11:18:37.299] Got some output, clearing connection timeout
[11:18:37.608] > Password:
[11:18:37.609] Showing password prompt
[11:18:40.335] Got password response
[11:18:40.336] "install" wrote data to terminal: "*******"
[11:18:40.372] >
[11:18:40.533] > 1dd6cf88d3c6: running
[11:18:40.591] > Unsupported platform: SunOS
> 1dd6cf88d3c6: start
> exitCode==35==
> listeningOn====
> osReleaseId==SunOS==
> arch====
> tmpDir==/tmp==
> platform====
> unpackResult====
> didLocalDownload==0==
> downloadTime====
> installTime====
> extInstallTime====
> serverStartTime====
> 1dd6cf88d3c6: end
[11:18:40.592] Received install output:
exitCode==35==
listeningOn====
osReleaseId==SunOS==
arch====
tmpDir==/tmp==
platform====
unpackResult====
didLocalDownload==0==
downloadTime====
installTime====
extInstallTime====
serverStartTime====
[11:18:40.594] Failed to parse remote port from server output
[11:18:40.595] Resolver error: Error:
at Function.Create (c:\Users\Raihan\.vscode\extensions\ms-vscode-remote.remote-ssh-0.78.0\out\extension.js:1:586041)
at Object.t.handleInstallOutput (c:\Users\Raihan\.vscode\extensions\ms-vscode-remote.remote-ssh-0.78.0\out\extension.js:1:584693)
at Object.t.tryInstall (c:\Users\Raihan\.vscode\extensions\ms-vscode-remote.remote-ssh-0.78.0\out\extension.js:1:681924)
at processTicksAndRejections (node:internal/process/task_queues:96:5)
at async c:\Users\Raihan\.vscode\extensions\ms-vscode-remote.remote-ssh-0.78.0\out\extension.js:1:644564
at async Object.t.withShowDetailsEvent (c:\Users\Raihan\.vscode\extensions\ms-vscode-remote.remote-ssh-0.78.0\out\extension.js:1:647909)
at async Object.t.resolve (c:\Users\Raihan\.vscode\extensions\ms-vscode-remote.remote-ssh-0.78.0\out\extension.js:1:645643)
at async c:\Users\Raihan\.vscode\extensions\ms-vscode-remote.remote-ssh-0.78.0\out\extension.js:1:722950
[11:18:40.605] ------
[11:18:41.251] > grep: illegal option -- a
> grep: illegal option -- E
> Usage: grep -hblcnsviw pattern file . . .
> grep: illegal option -- a
> grep: illegal option -- E
> Usage: grep -hblcnsviw pattern file . . .
[11:18:41.977] "install" terminal command done
[11:18:41.985] Install terminal quit with output: Usage: grep -hblcnsviw pattern file . . .
add this code in setting.json in file->Preference
"remote.SSH.remotePlatform": {
"$yourRemoteServerName": "linux"
}

Microsoft Visual Studio Code Remote-SSH could not establish connection

I am new to SSH. I am trying to connect to a Linux cluster at my school using remote-ssh in vscode. I am able to connect to a random Linux machine at my school using remote-ssh. I am able to connect to the Linux cluster just fine using PuTTY or Ubuntu. However, I keep getting errors with vscode.
It seems like it is trying to make a directory "home/user/", which isn't allowed. Is this a correct interpretation? How can I stop it from trying to connect to that directory? Or can a specify a different directory to go to?
Other students in my class are using vscode and have the same config settings, so I do not know why I am getting these errors specifically.
Any help would be much appreciated.
[15:39:07.990] Log Level: 2
[15:39:07.993] remote-ssh#XXXX
[15:39:07.993] win32 x64
[15:39:07.994] SSH Resolver called for "ssh-remote+cluster", attempt 1
[15:39:07.994] "remote.SSH.useLocalServer": false
[15:39:07.994] "remote.SSH.showLoginTerminal": false
[15:39:07.995] "remote.SSH.remotePlatform": {}
[15:39:07.995] "remote.SSH.sshPath": undefined
[15:39:07.995] "remote.SSH.sshConfigurationFile": C:\Users\user\.ssh\config
[15:39:07.995] "remote.SSH.useFlock": true
[15:39:07.995] "remote.SSH.lockfilesInTmp": false
[15:39:07.995] "remote.SSH.localServerDownload": auto
[15:39:07.995] "remote.SSH.remoteServerListenOnSocket": false
[15:39:07.995] "remote.SSH.showLoginTerminal": false
[15:39:07.995] "remote.SSH.defaultExtensions": []
[15:39:07.996] SSH Resolver called for host: cluster
[15:39:07.996] Setting up SSH remote "cluster"
[15:39:08.008] Using commit id "XXX" and quality "stable" for server
[15:39:08.012] Install and start server if needed
[15:39:11.878] Checking ssh with "ssh -V"
[15:39:11.906] > OpenSSH_for_Windows_7.7p1, LibreSSL 2.6.5
[15:39:11.911] Using SSH config file "C:\Users\user\.ssh\config"
[15:39:11.911] Running script with connection command: ssh -T -D 63620 -F "C:\Users\user\.ssh\config" "cluster" bash
[15:39:11.914] Terminal shell path: C:\WINDOWS\System32\cmd.exe
[15:39:11.952] >
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
> ]0;C:\WINDOWS\System32\cmd.exe
[15:39:11.953] Got some output, clearing connection timeout
[15:39:11.962] >
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
[15:39:12.185] > cluster's password:
[15:39:12.186] Showing password prompt
[15:39:15.805] Got password response
[15:39:15.806] "install" wrote data to terminal: "*******************"
[15:39:15.823] >
>
[15:39:16.275] > Could not chdir to home directory /cluster/home/user: No such file or directory
>
[15:39:16.292] > XXXXXXXXXXX: running
>
[15:39:16.515] > mkdir: cannot create directory ‘/cluster/home/user’
[15:39:16.522] > mkdir: cannot create directory ‘/cluster/home/user’Creating the server install dir failed...
> XXXXXXXXXX: start
> exitCode==34==
> listeningOn====
> osReleaseId====
> arch====
> tmpDir==/run/user/XXXXX==
> platform====
> unpackResult====
> didLocalDownload==0==
> downloadTime====
> installTime====
> extInstallTime====
> serverStartTime====
> XXXXXXXXXXX: end
> : Permission denied
>
[15:39:16.523] Received install output:
exitCode==34==
listeningOn====
osReleaseId====
arch====
tmpDir==/run/user/XXXXX==
platform====
unpackResult====
didLocalDownload==0==
downloadTime====
installTime====
extInstallTime====
serverStartTime====
[15:39:16.524] Failed to parse remote port from server output
[15:39:16.528] Resolver error: Error:
at Function.Create (c:\Users\user\.vscode\extensions\ms-vscode-remote.remote-ssh-0.65.1\out\extension.js:1:64328)
at Object.t.handleInstallOutput (c:\Users\user\.vscode\extensions\ms-vscode-remote.remote-ssh-0.65.1\out\extension.js:1:63022)
at q (c:\Users\user\.vscode\extensions\ms-vscode-remote.remote-ssh-0.65.1\out\extension.js:1:296373)
at processTicksAndRejections (internal/process/task_queues.js:97:5)
at async c:\Users\user\.vscode\extensions\ms-vscode-remote.remote-ssh-0.65.1\out\extension.js:1:294221
at async Object.t.withShowDetailsEvent (c:\Users\user\.vscode\extensions\ms-vscode-remote.remote-ssh-0.65.1\out\extension.js:1:407055)
at async Object.t.resolve (c:\Users\user\.vscode\extensions\ms-vscode-remote.remote-ssh-0.65.1\out\extension.js:1:297912)
at async c:\Users\user\.vscode\extensions\ms-vscode-remote.remote-ssh-0.65.1\out\extension.js:127:110485
[15:39:16.534] ------

Connecting to remote linux server with VSCode through WSL - File location issue?

When attempting to use VS Code / WSL to remote into a linux server hosted as a Digital Ocean droplet, we're getting this error:
[17:38:24.258] Log Level: 2
[17:38:24.260] remote-ssh#0.63.0
[17:38:24.260] win32 x64
[17:38:24.262] SSH Resolver called for "ssh-remote+100.100.10.100", attempt 1
[17:38:24.263] "remote.SSH.useLocalServer": false
[17:38:24.263] "remote.SSH.showLoginTerminal": false
[17:38:24.263] "remote.SSH.remotePlatform": {"$remote_server_name":"linux"}
[17:38:24.264] "remote.SSH.sshPath": undefined
[17:38:24.264] "remote.SSH.sshConfigurationFile": undefined
[17:38:24.264] "remote.SSH.useFlock": true
[17:38:24.265] "remote.SSH.lockfilesInTmp": false
[17:38:24.265] "remote.SSH.localServerDownload": auto
[17:38:24.265] "remote.SSH.remoteServerListenOnSocket": false
[17:38:24.265] "remote.SSH.showLoginTerminal": false
[17:38:24.266] SSH Resolver called for host: 100.100.10.100
[17:38:24.266] Setting up SSH remote "100.100.10.100"
[17:38:24.278] Using commit id "ea3859d4ba2f3e577a159bc91e3074c5d8c0523" and quality "stable" for server
[17:38:24.285] Install and start server if needed
[17:38:25.556] Checking ssh with "ssh -V"
[17:38:25.713] > OpenSSH_for_Windows_7.7p1, LibreSSL 2.6.5
[17:38:25.726] Running script with connection command: ssh -T -D 53538 "100.100.10.100" bash
[17:38:25.735] Terminal shell path: C:\WINDOWS\System32\cmd.exe
[17:38:26.931] > no such identity: /home/user/.ssh/id_rsa: No such file or directory
> ]0;C:\WINDOWS\System32\cmd.exe
[17:38:26.933] Got some output, clearing connection timeout
[17:38:26.940] > root#100.100.10.100: Permission denied (publickey).
> The process tried to write to a nonexistent pipe.
As far as I can see, the issue lies with
[17:38:26.931] > no such identity: /home/user/.ssh/id_rsa: No such file or directory
However
ssh -vv root#100.100.10.100 -i /home/user/.ssh/id_rsa
Successfully connects in the debug and server is accessed
debug1: Authentication succeeded (publickey).
So this must be some issue with specifying the location of id_rsa in the config file for VS Code.
Host 100.100.10.100
HostName 100.100.10.100
User root
ForwardAgent yes
IdentityFile /home/autosermo/.ssh/id_rsa
We have tried everything we can think of for the value of IdentityFile (...~/.ssh/id_rsa etc) but cannot nail it down.
What are the other possible locations / what path should be provided to IdentityFile here?
Thank you
WSL is a bit of a red-herring here. When you are using the "Remote - SSH" extension in VSCode, you aren't going through WSL at all. As you can see from this line in the output ...
[17:38:25.713] > OpenSSH_for_Windows_7.7p1, LibreSSL 2.6.5
... It's using OpenSSH for Windows.
The location for your private key in OpenSSH should be %userprofile%/.ssh (so something like C:\Users\username\.ssh). Try placing it there. Also try executing your ssh command from PowerShell or cmd rather than WSL, since that's the one being used by VSCode.

VS code keeps reconnecting to remote ssh

Problem: VS code keeps disconnecting / reconnecting ssh with remote machine.
After entering password it immediately comes back with password prompt again.
The logs suggest that vs code server fails.
Are there any vs code server logs I can review on the remote machine?
Details: VS code ver 1.4.5 / Windows 10;
Remote: Macbook Air (High Sierra)
Logs are below:
[09:49:41.088] > Password:
[09:49:41.088] Showing password prompt
[09:49:45.455] Got password response
[09:49:45.456] "install" wrote data to terminal: "********"
[09:49:45.889] > 028771948a23: running
[09:49:45.922] > Acquiring lock on /Users/user/.vscode-server/bin/5763d909d5f12fe19f215cbfdd
> 29a91c0fa9208a/vscode-remote-lock.user.5763d909d5f12fe19f215cbfdd29a91c0fa9
> 208a
> \ln /Users/user/.vscode-server/bin/5763d909d5f12fe19f215cbfdd29a91c0fa9208a
> /vscode-remote-lock.user.5763d909d5f12fe19f215cbfdd29a91c0fa9208a.target /U
> sers/user/.vscode-server/bin/5763d909d5f12fe19f215cbfdd29a91c0fa9208a/vscod
> e-remote-lock.user.5763d909d5f12fe19f215cbfdd29a91c0fa9208a
>
[09:49:45.943] > Found existing installation at /Users/user/.vscode-server/bin/5763d909d5f12
> fe19f215cbfdd29a91c0fa9208a...
>
[09:49:46.017] > Found running server...
[09:49:46.050] > Checking server status on port 58236 with curl
>
[09:49:46.083] > 000
> 028771948a23##28##
>
[09:49:46.083] Received install output: 028771948a23##28##
[09:49:46.083] Server status check failed - waiting and retrying
[09:49:46.364] "install" terminal command done
[09:49:46.364] Install terminal quit with output:
[09:49:47.091] Running script with connection command: "C:\Program Files\Git\usr\bin\ssh.exe" -T -D
55978 10.0.0.134 bash
[09:49:47.092] Terminal shell path: C:\Windows\System32\cmd.exe
[09:49:47.275] >
[09:49:47.281] Got some output, clearing connection timeout
[09:49:50.747] > Password:
[09:49:50.748] Showing password prompt