【问题标题】:Remote editing over ssh to windows server通过 ssh 远程编辑到 windows 服务器
【发布时间】:2019-12-20 08:48:02
【问题描述】:

Remote SSH 插件声明 VS Code Insiders 使用 official OpenSSH server 对 Windows 10/Server 1803+ 提供实验性支持。

我在 Windows Server 2019 1809 上安装并配置了官方 OpenSSH 服务器。我可以通过 pubkey 身份验证进行连接,并且 PowerShell Core over ssh 也可以正常工作。我尝试了 Remote SSH 和 Remote SSH nightly 插件。起初它抱怨找不到 bash。所以我安装了 git bash 并将其添加到系统路径中。尝试连接到我的 Windows 服务器时出现以下错误:

[16:02:41.398] Log Level: 3
[16:02:41.399] remote-ssh-nightly@2019.12.24000
[16:02:41.399] darwin x64
[16:02:41.401] SSH Resolver called for "ssh-remote+myserver", attempt 1
[16:02:41.401] SSH Resolver called for host: myserver
[16:02:41.401] Setting up SSH remote "myserver"
[16:02:41.413] Using commit id "e74405d11443c5361c31e2bc341866d146eee206" and quality "insider" for server
[16:02:41.414] Testing ssh with ssh -V
[16:02:41.425] ssh exited with code: 0
[16:02:41.425] Got stderr from ssh: OpenSSH_7.9p1, LibreSSL 2.7.3
[16:02:41.430] Running script with connection command: ssh -T -D 51951 -o ConnectTimeout=15 myserver bash
[16:02:41.430] Install and start server if needed
[16:02:43.451] > 5122b1a5b835: running
> Unsupported architecture: MINGW64_NT-10.0-17763 x86_64
> 5122b1a5b835##27##
[16:02:43.452] Got some output, clearing connection timeout
[16:02:43.710] "install" terminal command done
[16:02:43.710] Install terminal quit with output: 5122b1a5b835##27##
[16:02:43.710] Received install output: 5122b1a5b835##27##
[16:02:43.710] Unsupported architecture
[16:02:43.711] Resolver error: The remote host's architecture is not supported
[16:02:43.714] ------

 

有人知道让远程 SSH 与 Windows 10/Server 一起工作的秘诀吗?

【问题讨论】:

    标签: visual-studio-code vscode-remote


    【解决方案1】:

    看起来 VSCode 正在尝试在服务器上运行 bash,我猜它会解析为 git 的 bash,我记得它是基于 mingw 的。 VSCode 应该在服务器上运行 Powershell。

    您是否将您的服务器包含在扩展程序设置的 Windows 远程列表中?

    【讨论】:

    • 我没有 Windows 远程设置。在您回复之前几秒钟找到这篇文章。谢谢!!
    【解决方案2】:

    需要“remote.SSH.windowsRemotes”设置。这是documentation

    "remote.SSH.windowsRemotes": ["myserver"]

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 2015-06-27
      • 1970-01-01
      • 2023-03-08
      • 2016-12-17
      • 2017-02-15
      • 1970-01-01
      • 2019-09-15
      • 2019-03-30
      相关资源
      最近更新 更多