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 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".
Feedback
Was this page helpful?
Provide feedbackThank you very much for your feedback. We will continue working to improve the documentation.