V2EX = way to explore
V2EX 是一个关于分享和探索的地方
现在注册
已注册用户请  登录
gromit1337
V2EX  ›  macOS

macOS 使用 VS code 的 remote ssh 插件

  •  
  •   gromit1337 · 2020-03-24 22:39:11 +08:00 · 3151 次点击
    这是一个创建于 1724 天前的主题,其中的信息可能已经有所发展或是发生改变。

    这个插件功能出了很久了,可是我一次都没连上过我的搬瓦工主机,搜了半天攻略还是不得其解,不知道是我哪里的姿势没用对 也没搜到和我一样错误代码 15 的,这是我看的一篇教程 remote-ssh

    3 条回复    2020-03-29 02:26:19 +08:00
    coolcoffee
        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 可以正常连接进去。
    gromit1337
        2
    gromit1337  
    OP
       2020-03-27 20:21:36 +08:00
    @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] ------
    gromit1337
        3
    gromit1337  
    OP
       2020-03-29 02:26:19 +08:00
    @coolcoffee 拿 windows 试了一下,一次就连上了😩
    关于   ·   帮助文档   ·   博客   ·   API   ·   FAQ   ·   实用小工具   ·   986 人在线   最高记录 6679   ·     Select Language
    创意工作者们的社区
    World is powered by solitude
    VERSION: 3.9.8.5 · 23ms · UTC 18:52 · PVG 02:52 · LAX 10:52 · JFK 13:52
    Developed with CodeLauncher
    ♥ Do have faith in what you're doing.