首页 > 解决方案 > VSCode Remote-SSH 无法连接到我的服务器

问题描述

最近我无法在 Vscode 编辑器上使用 Remote-SSH 连接到我的服务器。像这样的详细信息

> [19:13:42.444] Log Level: 2 [19:13:42.448] remote-ssh@0.50.0
> [19:13:42.448] win32 x64 [19:13:42.449] SSH Resolver called for
> "ssh-remote+140.122.184.164", attempt 1 [19:13:42.449] SSH Resolver
> called for host: 140.122.184.164 [19:13:42.449] Setting up SSH remote
> "140.122.184.164" [19:13:42.452] Acquiring local install lock:
> C:\Users\Acer\AppData\Local\Temp\vscode-remote-ssh-140.122.184.164-install.lock
> [19:13:42.464] Looking for existing server data file at
> c:\Users\Acer\AppData\Roaming\Code\User\globalStorage\ms-vscode-remote.remote-ssh\vscode-ssh-host-140.122.184.164-78a4c91400152c0f27ba4d363eb56d2835f9903a\data.json
> [19:13:42.464] Using commit id
> "78a4c91400152c0f27ba4d363eb56d2835f9903a" and quality "stable" for
> server [19:13:42.465] Install and start server if needed
> [19:13:42.468] Checking ssh with "ssh -V" [19:13:42.514] >
> OpenSSH_for_Windows_7.7p1, LibreSSL 2.6.5 [19:13:42.515] Checking ssh
> with "C:\WINDOWS\System32\OpenSSH\ssh.exe -V" [19:13:42.547] >
> OpenSSH_for_Windows_7.7p1, LibreSSL 2.6.5 [19:13:42.547] Checking ssh
> with "C:\Program Files\Git\usr\bin\ssh.exe -V" [19:13:42.581] >
> OpenSSH_8.1p1, OpenSSL 1.1.1d  10 Sep 2019 [19:13:42.583] askpass
> server listening on
> \\.\pipe\vscode-ssh-askpass-a5415762a34cef86c303cb95e6068cc83f77ad45-sock
> [19:13:42.583] Spawning local server with
> {"ipcHandlePath":"\\\\.\\pipe\\vscode-ssh-askpass-2f67c00bee72c5d0d1a3761b3a9ce7fa93226b8b-sock","sshCommand":"C:\\Program
> Files\\Git\\usr\\bin\\ssh.exe","sshArgs":["-v","-T","-D","52132","140.122.184.164"],"dataFilePath":"c:\\Users\\Acer\\AppData\\Roaming\\Code\\User\\globalStorage\\ms-vscode-remote.remote-ssh\\vscode-ssh-host-140.122.184.164-78a4c91400152c0f27ba4d363eb56d2835f9903a\\data.json"} [19:13:42.583] Local server env:
> {"DISPLAY":"1","ELECTRON_RUN_AS_NODE":"1","SSH_ASKPASS":"c:\\Users\\Acer\\.vscode\\extensions\\ms-vscode-remote.remote-ssh-0.50.0\\out\\local-server\\askpass.bat","VSCODE_SSH_ASKPASS_NODE":"C:\\Users\\Acer\\AppData\\Local\\Programs\\Microsoft
> VS
> Code\\Code.exe","VSCODE_SSH_ASKPASS_MAIN":"c:\\Users\\Acer\\.vscode\\extensions\\ms-vscode-remote.remote-ssh-0.50.0\\out\\askpass-main.js","VSCODE_SSH_ASKPASS_HANDLE":"\\\\.\\pipe\\vscode-ssh-askpass-a5415762a34cef86c303cb95e6068cc83f77ad45-sock"}
> [19:13:42.588] Spawned 4652 [19:13:42.675] > local-server> Spawned
> ssh: 7024 [19:13:42.701] stderr> OpenSSH_8.1p1, OpenSSL 1.1.1d  10 Sep
> 2019 [19:13:42.828] stderr> debug1: Server host key:
> ecdsa-sha2-nistp256 SHA256:Zs/tS7SoUebvH2cFNl3/myVG+/wSM2ET0ucLj6D9H00
> [19:13:43.042] Got askpass request:
> {"request":"Wendy@140.122.184.164's password: "} [19:13:43.042]
> Showing password prompt [19:13:43.043] Listening for interwindow
> password on
> \\.\pipe\vscode-ssh-askpass-517f0ea068bd7eb6da8a4c8052ea3b542e429ade-sock
> [19:13:43.043] Writing password prompt to globalState

我不确定它有什么问题。我的服务器有一个 .vscode 文件夹。会不会有问题呢?

.vscode 文件夹有 settings.json 像这样

{
    "git.ignoreLimitWarning": true
}

和这样的 sftp.json 文件

> {
>     "name": "Wendy",
>     "host": "140.122.184.164",
>     "protocol": "sftp",
>     "port": 9600,
>     "username": "Wendy",
>     "remotePath": "/share/nas165/Wendy",
>     "uploadOnSave": true }

标签: visual-studio-codesshvscode-settingscode-editorremote-connection

解决方案


我没有解决方案,但有解决该问题的方法。您现在需要回滚扩展的版本。使用以下版本,我可以解决该问题:

  • 远程开发 == 0.19.0
  • 远程 SSH == 0.49.0

这里描述了如何回滚版本: vs code - 回滚扩展/安装特定扩展版本


推荐阅读