vscode配置远程连接失败:过程试图写入的管道不存在(已解决)

最近一直使用腾讯云的服务器作为远程开发环境,以前一直很好用。直到最近重装了系统之后,发现vscode没法对云服务器进行连接了,即使在远程主机添加了本地的公钥也不行。而通过mobaxterm使用云服务器的密钥则可以连接。

直到昨天的时候,详细的看了一下vscode的报错日志,才知道原来是本地的known_hosts文件记录服务器信息与现服务器的信息冲突了,导致连接失败。

下面是报错信息

[20:46:09.521] Log Level: 3
[20:46:09.530] [email protected]
[20:46:09.530] win32 x64
[20:46:09.531] SSH Resolver called for "ssh-remote+7b22686f73744e616d65223a2254656e63656e74227d", attempt 1
[20:46:09.532] SSH Resolver called for host: Tencent
[20:46:09.532] Setting up SSH remote "Tencent"
[20:46:09.559] Using commit id "c47d83b293181d9be64f27ff093689e8e7aed054" and quality "stable" for server
[20:46:09.559] Install and start server if needed
[20:46:09.565] Checking ssh with "ssh -V"
[20:46:09.625] > OpenSSH_for_Windows_7.7p1, LibreSSL 2.6.5
[20:46:09.628] Running script with connection command: ssh -T -D 51303 Tencent bash
[20:46:09.630] Terminal shell path: C:\WINDOWS\System32\cmd.exe
[20:46:09.776] > 
> 
...
> �]0;C:\WINDOWS\System32\cmd.exe�
[20:46:09.776] Got some output, clearing connection timeout
[20:46:09.783] > 
> 
...
[20:46:09.992] > @@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@
> 
[20:46:09.999] > @    WARNING: REMOTE HOST IDENTIFICATION HAS CHANGED!     @
> @@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@
> IT IS POSSIBLE THAT SOMEONE IS DOING SOMETHING NASTY!
> Someone could be eavesdropping on you right now (man-in-the-middle attack)!     
> It is also possible that a host key has just been changed.
> The fingerprint for the ECDSA key sent by the remote host is
> SHA256:teZb8yKzveqH5iVGOEalepGRmKhWlD2LZLNe0QqOChg.
> Please contact your system administrator.
> Add correct host key in C:\\Users\\bob/.ssh/known_hosts to get rid of this mes
> sage.
> Offending ECDSA key in C:\\Users\\bob/.ssh/known_hosts:14
> ECDSA host key for 106.*.249.* has changed and you have requested strict chec
> king.
> Host key verification failed.
> 过程试图写入的管道不存在。
> 
[20:46:10.332] "install" terminal command done
[20:46:10.332] Install terminal quit with output: 过程试图写入的管道不存在。
[20:46:10.332] Received install output: 过程试图写入的管道不存在。
[20:46:10.334] Stopped parsing output early. Remaining text: 过程试图写入的管道不存在。
[20:46:10.334] Failed to parse remote port from server output
[20:46:10.335] Resolver error: 
[20:46:10.341] ------

解决方案就是把本地的known_hosts的原服务器信息全部删掉(根据IP地址删除),然后重新连接就可以了。

你可能感兴趣的:(vscode配置远程连接失败:过程试图写入的管道不存在(已解决))