VSCode remote connection server reported an error: Could not establish connection to "xxxxxx" [Solved]

created at 08-08-2021 views: 2

Assuming you have done the following configuration and try

  • Installed Remote -SSH in Extensions
  • Added information such as the ip address of the server you want to access, and has a config file (as shown below)
  • Please remember the path of this config file, generally C:\Users\user_name\.ssh\config

p address of the server

So you start to try to connect to the server. After choosing Linux/Windows from the drop-down menu at the top, it unfortunately fails.

Error message

After the error message Could not establish connection to “xxx” appears, check the error message below. If the error message contains:

error information

Solution

1. Open Extensions in the left column, find the installed Remote -SSH, right-click, and select "Extension Settings"

installed Remote -SSH

2. Enter the config file path just now in Config File

 Config File

3. Retry the connection and found success

created at:08-08-2021
edited at: 08-08-2021: