这个插件功能出了很久了,可是我一次都没连上过我的搬瓦工主机,搜了半天攻略还是不得其解,不知道是我哪里的姿势没用对 也没搜到和我一样错误代码 15 的,这是我看的一篇教程 remote-ssh
1
coolcoffee 2020-03-25 11:57:19 +08:00
remote ssh 是基于 ssh config 来连接的。首先你得保证通过终端可以正常连接。
例如 ssh_config 里面的是: ``` Host ubuntu-playground HostName 192.168.1.233 User root IdentityFile ~/.ssh/id_rsa ``` 你通过 ssh ubuntu-playground 可以正常连接进去。 |
2
gromit1337 OP @coolcoffee 我确实通过 config 里配置,然后命令行 ssh+名称 连接上了,但是在 vscode remote 就不成功。
[20:19:50.310] Log Level: 2 [20:19:50.311] [email protected] [20:19:50.311] darwin x64 [20:19:50.313] SSH Resolver called for "ssh-remote+bwg", attempt 1 [20:19:50.313] SSH Resolver called for host: bwg [20:19:50.313] Setting up SSH remote "bwg" [20:19:50.317] Acquiring local install lock: /var/folders/42/kkv_4hkj363gnhch31wyh2tm0000gn/T/vscode-remote-ssh-bwg-install.lock [20:19:50.354] Looking for existing server data file at /Users/gromit/Library/Application Support/Code/User/globalStorage/ms-vscode-remote.remote-ssh/vscode-ssh-host-bwg-0ba0ca52957102ca3527cf479571617f0de6ed50-0.50.1/data.json [20:19:50.355] Using commit id "0ba0ca52957102ca3527cf479571617f0de6ed50" and quality "stable" for server [20:19:50.357] Install and start server if needed [20:19:50.365] Checking ssh with "ssh -V" [20:19:50.391] > OpenSSH_8.1p1, LibreSSL 2.7.3 [20:19:50.393] askpass server listening on /var/folders/42/kkv_4hkj363gnhch31wyh2tm0000gn/T/vscode-ssh-askpass-b25c2705459902cc5ea1148dd16791ff95a6b846.sock [20:19:50.394] Spawning local server with {"ipcHandlePath":"/var/folders/42/kkv_4hkj363gnhch31wyh2tm0000gn/T/vscode-ssh-askpass-c2110e60fe1c3298ca0846356ff564d01a2e48b2.sock","sshCommand":"ssh","sshArgs":["-v","-T","-D","50833","-o","ConnectTimeout=15","bwg"],"dataFilePath":"/Users/gromit/Library/Application Support/Code/User/globalStorage/ms-vscode-remote.remote-ssh/vscode-ssh-host-bwg-0ba0ca52957102ca3527cf479571617f0de6ed50-0.50.1/data.json"} [20:19:50.394] Local server env: {"DISPLAY":"1","ELECTRON_RUN_AS_NODE":"1","SSH_ASKPASS":"/Users/gromit/.vscode/extensions/ms-vscode-remote.remote-ssh-0.50.1/out/local-server/askpass.sh","VSCODE_SSH_ASKPASS_NODE":"/Applications/Visual Studio Code.app/Contents/Frameworks/Code Helper (Renderer).app/Contents/MacOS/Code Helper (Renderer)","VSCODE_SSH_ASKPASS_MAIN":"/Users/gromit/.vscode/extensions/ms-vscode-remote.remote-ssh-0.50.1/out/askpass-main.js","VSCODE_SSH_ASKPASS_HANDLE":"/var/folders/42/kkv_4hkj363gnhch31wyh2tm0000gn/T/vscode-ssh-askpass-b25c2705459902cc5ea1148dd16791ff95a6b846.sock"} [20:19:50.396] Spawned 9387 [20:19:50.515] > local-server> Spawned ssh: 9388 [20:19:50.520] stderr> OpenSSH_8.1p1, LibreSSL 2.7.3 [20:19:52.004] stderr> debug1: Server host key: ecdsa-sha2-nistp256 SHA256:NtrEQTz+9llUjzWckLPURGaw9SemlgpVMaxJgjoqpWQ [20:20:07.401] Terminating local server [20:20:07.405] Resolver error: Connecting with SSH timed out [20:20:07.410] Local server exit: 15 [20:20:07.412] ------ |
3
gromit1337 OP @coolcoffee 拿 windows 试了一下,一次就连上了😩
|