microsoft / vscode-remote-release

Visual Studio Code Remote Development: Open any folder in WSL, in a Docker container, or on a remote machine using SSH and take advantage of VS Code's full feature set.
https://aka.ms/vscode-remote
Other
3.6k stars 274 forks source link

No SSH hosts have been configured yet #1226

Closed 1016990109 closed 5 years ago

1016990109 commented 5 years ago

Steps to Reproduce:

  1. Configure a SSH host
  2. set config:
    Host AliServer
    HostName 1.1.1.1 # 填写远程服务器的IP或者Host
    User     username # 填写登陆远程服务器的用户的名字
  3. save
  4. refresh CONNECTIONS
  5. no changes

image

Does this issue occur when you try this locally?: Yes Does this issue occur when you try this locally and all extensions are disabled?: N/A

roblourens commented 5 years ago

Not sure what the problem is. Can you open the ssh config and find the log in the Remote-SSH output channel and share that here?

Also, do you see any errors in the devtools console? (Help > Toggle developer tools)

1016990109 commented 5 years ago

Not sure what the problem is. Can you open the ssh config and find the log in the Remote-SSH output channel and share that here?

Also, do you see any errors in the devtools console? (Help > Toggle developer tools)

@roblourens The ssh config:

Host AliServer
    HostName 9.154.15.52
    User     root

But I can't find any SSH hosts in the "REMOTE-SSH" side bar (it should have one host named "AliServer"), it shows "No SSH hosts have been configured yet.Configure a SSH host".

image

And I can't see any errors in the devtools console.

roblourens commented 5 years ago

In the config path setting, can you try using an absolute path instead of ~? This works for me but that's the only complication that I can think of here.

1016990109 commented 5 years ago

Thank you! It works now after using an absolute path. @roblourens

roblourens commented 5 years ago

Hm, the ~ should work, so is there something weird with your user directory? If you do

cd ~
pwd

in a terminal, do you see the path you expect?

or ls -l ~/.ssh/aigate_dev_config

1016990109 commented 5 years ago

Yes, I can see aigate_dev_config in ~/.ssh directory. But when I use ~, I can't find any hosts in the side bar.

roblourens commented 5 years ago

If you have node installed on your computer, could you try running node -p "require('os').homedir()"?