如何解决我如何使用 VScode 1.53.2 SSH 到 Ubuntu 14.04 VM 服务器
使用 VS 代码通过 ssh 连接到 Ubuntu 14.04 服务器。起初我什至无法连接,但是在输入密码后为 Windows 安装 git 后,我得到:无法建立与“主机名”的连接。 我可以使用 putty 或 powershell ssh 进入这台服务器。
这是 VS 代码的输出:
[13:55:01.574] Got password response
[13:55:01.575] "install" wrote data to terminal: "********************"
[13:55:01.605] >
>
[13:55:04.040] "install" terminal command done
[13:55:04.040] Install terminal quit with output:
[13:55:04.040] Received install output:
[13:55:04.041] Stopped parsing output early. Remaining text:
[13:55:04.041] Failed to parse remote port from server output
[13:55:04.048] Resolver error: Error:
at Function.Create (c:\Users\Turro\.vscode\extensions\ms-vscode-remote.remote-ssh-0.64.0\out\extension.js:1:64126)
at Object.t.handleInstallOutput (c:\Users\Turro\.vscode\extensions\ms-vscode-remote.remote-ssh-0.64.0\out\extension.js:1:62865)
at k (c:\Users\Turro\.vscode\extensions\ms-vscode-remote.remote-ssh-0.64.0\out\extension.js:1:313462)
at processTicksAndRejections (internal/process/task_queues.js:97:5)
at async c:\Users\Turro\.vscode\extensions\ms-vscode-remote.remote-ssh-0.64.0\out\extension.js:1:311339
at async Object.t.withShowDetailsEvent (c:\Users\Turro\.vscode\extensions\ms-vscode-remote.remote-ssh-0.64.0\out\extension.js:1:406337)
at async Object.t.resolve (c:\Users\Turro\.vscode\extensions\ms-vscode-remote.remote-ssh-0.64.0\out\extension.js:1:315001)
at async c:\Users\Turro\.vscode\extensions\ms-vscode-remote.remote-ssh-0.64.0\out\extension.js:127:110431
[13:55:04.054] ------
提前致谢,很高兴提供解决此问题所需的更多信息!
解决方法
我可以使用 putty 或 powershell ssh 进入这台服务器。
这可能意味着您使用的是带有 putty ppk format 的 SSH 密钥,而不是 OpenSSH。
尝试从会话中启动 VSCode,其中:
-
%PATH%
不引用 Putty(但包含 Git 及其usr/bin
文件夹) -
GIT_SSH
环境变量设置为ssh
(虽然它应该不需要,如果 PATH 设置正确)
版权声明:本文内容由互联网用户自发贡献,该文观点与技术仅代表作者本人。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌侵权/违法违规的内容, 请发送邮件至 dio@foxmail.com 举报,一经查实,本站将立刻删除。