Can't connect VS Code to Linux machine for remote development

后端 未结 3 1004
醉梦人生
醉梦人生 2021-02-05 10:47

I am getting this error on VS Code and have no clue why it fails

[15:14:59.543] Log Level: 2
[15:14:59.555] remote-ssh@0.51.0
[15:14:59.555] win32 x64
[15:14:59.         


        
相关标签:
3条回答
  • 2021-02-05 11:00

    In dialog box where you have typed user@host type/select Linux/Windows/etc. depends what you are using, then type/select Continue, then type password for remote session.

    0 讨论(0)
  • 2021-02-05 11:07

    Add one key in your settings.json as below. Please remember to replace the $remote_server_name to yours.

        "remote.SSH.remotePlatform": {
            "$remote_server_name": "linux"
        }
    
    

    Menu: File->Preference->Settings

    Or click the icon to open settings.json:

    0 讨论(0)
  • 2021-02-05 11:17

    For those getting this error on Windows: Check if you have multiple ssh clients installed.

    How I solved it was by adding my ssh-configuration to ALL ssh-config files. In my case I had one in

    • C:\Users\USER_NAME.ssh\config (this is the one that the remote extension used to give me connection options)
    • and another in C:\Program Data\ssh\ssh-config

    After adding my ssh-config setting to both I got the prompt to select virtual hosts' OS. Tried editing the settings.json file directly, but I think it gets confused because of the multiple ssh-configurations.

    P.S.

    Tested it for both private key and password enabled connections and it work with either.

    0 讨论(0)
提交回复
热议问题