Help Center/ ModelArts/ FAQs/ Notebook (New Version)/ Failures to Access the Development Environment Through VS Code/ 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?
Updated on 2024-06-15 GMT+08:00

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

Or

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 fails to be installed, manually download the OpenSSH installation package and perform the following operations:

  1. Download the .zip package and decompress it into C:\Windows\System32.
  2. In C:\Windows\System32\OpenSSH-xx, open CMD as the administrator and run the following command:

     powershell.exe -ExecutionPolicy Bypass -File install-sshd.ps1

  3. Add C:\Program Files\OpenSSH-xx (in which the SSH executable .exe file is stored) to environment system variables.
  4. Open CMD again and run ssh. If the following information is displayed, the installation is successful. Otherwise, go to 5 and 6.

  5. 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

  6. 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".