Virtual Geek

Tales from real IT system administrators world and non-production environment

VS code remote ssh could not establish to host, connecting was canceled

This article is based on one of the issues I was facing while configuring VSCode Remote - SSH. 

Earlier Parts
How to Setup Passwordless SSH Login on Windows
configure remote ssh extension on visual studio code

Here I configured second linux host in ssh config file. This one is not passwordless.

vs code visaul studio code remote - ssh remote development troubleshooting adding another host remote file over ssh scp with visual studio code  ssh target remote explorer.png

When I connect to the second linux server for first time it asked to verify fingerprint key of linux and continue, it will confirm connecting yes, If you don't press connect you will receive popup Could not establish connection to 'IP/FQDN' Connecting was canceled. Next Enter password for root, Click details in the bottoms to check logs on OUTPUT tab.

vs code remote ssh opening remote ssh could not establish connection to ssh server fingerprint continue connecting close remote continue enter password prompt setting up host initiating vs code server.png

You will receive similar error Copying  file to remote with scp vscode-server-linux.x64.tar.gz vscode-scp-done.flag IP:~/.vscode-server/bin/8795a9889db74563ddd43eb0a897a2384129a81619/.  To resolve this issue download vscode-server-linux.x64.tar.gz from url and upload on linux under folder ~/.vscode-server/bin/8795a9889db74563ddd43eb0a897a2384129a81619/. Once the file copied try connecting with remote ssh again. It will be successful.

visual studio code microsoft remote ssh extension copying file to remote with scp vscode-server-linux-x64.tar.gz download client connection successfull wget setup ssh host.png

You can see the file I have copied the file manually using winscp, once file is copied extract / untar it with command tar xvzf vscode-server-linux.x64.tar.gz

.vscode-server vscode-server-linux-x64.tar.gz no ssh key known_hosts no private key or public key, ssh-keygen visual studio code extention marketplace remote-ssh remote ssh.png

Useful Articles
Docker Error response from daemon i\o timeout internet proxy
Cannot connect to the Docker daemon at unix:var run docker.sock. Is the docker daemon running
How to install Docker on Linux
How to install Ansible on Linux for vSphere configuration

Go Back


Blog Search

Page Views


Follow me on Blogarama