What Do I Do If Error Message "An SSH installation couldn't be found" or "Could not establish connection to instance xxx: 'ssh' ..." Is Displayed?
Symptom
When VS Code attempts to access a notebook instance, the system always prompts you to select a certificate, and the message, excepting the title, consists of garbled characters. After the certificate is selected, the system still does not respond and the connection failed.
Possible Cause
OpenSSH is not installed in the current environment or is not installed in the default path. For details, see the
VS Code document
.
Solution
If OpenSSH is not installed in the current environment,
download and install it
.
If OpenSSH fails to be installed, manually
download the OpenSSH installation package
and perform the following operations:
Download the .zip package and decompress it into
C:\Windows\System32
.
In
C:\Windows\System32
\OpenSSH-xx
, open CMD as the administrator and run the following command:
powershell.exe -ExecutionPolicy Bypass -File install-sshd.ps1
Add
C:\Program Files\OpenSSH-xx
(in which the SSH executable .exe file is stored) to environment system variables.
Open CMD again and run
ssh
. If the following information is displayed, the installation is successful. Otherwise, go to
5
and
6
.
Enable port 22 (default OpenSSH port) on the firewall and run the following command in Command Prompt:
netsh advfirewall firewall add rule name=sshd dir=in action=allow protocol=TCP localport=22
Run the following command to start OpenSSH:
Start-Service sshd
If OpenSSH is not installed in the default path, open the command panel (
Ctrl+Shift+P
for Windows and
Cmd+Shift+P
for macOS).
Search for
Open settings
.
Add
remote.SSH.path
to
settings.json
, for example,
"remote.SSH.path": "
Installation path of the local OpenSSH
"
.
What Do I Do If the VS Code Window Is Not Displayed?
What Do I Do If a Remote Connection Failed After VS Code Is Opened?
What Do I Do If Error Message "Could not establish connection to xxx" Is Displayed During a Remote Connection?
What Do I Do If the Connection to a Remote Development Environment Remains in "Setting up SSH Host xxx: Downloading VS Code Server locally" State for More Than 10 Minutes?
What Do I Do If the Connection to a Remote Development Environment Remains in the State of "Setting up SSH Host xxx: Downloading VS Code Server locally" for More Than 10 Minutes?
What Do I Do If the Connection to a Remote Development Environment Remains in the State of "ModelArts Remote Connect: Connecting to instance xxx..." for More Than 10 Minutes?
What Do I Do If a Remote Connection Is in the Retry State?
What Do I Do If Error Message "The VS Code Server failed to start" Is Displayed?
What Do I Do If Error Message "Permissions for 'x:/xxx.pem' are too open" Is Displayed?
What Do I Do If Error Message "Bad owner or permissions on C:\Users\Administrator/.ssh/config" or "Connection permission denied (publickey)" Is Displayed?
What Do I Do If Error Message "ssh: connect to host xxx.pem port xxxxx: Connection refused" Is Displayed?
What Do I Do If Error Message "ssh: connect to host ModelArts-xxx port xxx: Connection timed out" Is Displayed?
What Do I Do If Error Message "Load key "C:/Users/xx/test1/xxx.pem": invalid format" Is Displayed?
What Do I Do If Error Message "An SSH installation couldn't be found" or "Could not establish connection to instance xxx: 'ssh' ..." Is Displayed?
What Do I Do If Error Message "no such identity: C:/Users/xx /test.pem: No such file or directory" Is Displayed?
What Do I Do If Error Message "Host key verification failed" or "Port forwarding is disabled" Is Displayed?
What Do I Do If Error Message "Failed to install the VS Code Server" or "tar: Error is not recoverable: exiting now" Is Displayed?
What Do I Do If Error Message "XHR failed" Is Displayed When a Remote Notebook Instance Is Accessed Through VS Code?
What Do I Do for an Automatically Disconnected VS Code Connection If No Operation Is Performed for a Long Time?
What Do I Do If It Takes a Long Time to Set Up a Remote Connection After VS Code Is Automatically Upgraded?
What Do I Do If Error Message "Connection reset" Is Displayed During an SSH Connection?
What Can I Do If a Notebook Instance Is Frequently Disconnected or Stuck After I Use MobaXterm to Connect to the Notebook Instance in SSH Mode?