【问题标题】:How to set ControlMaster with Remote-SSH in Visual Studio Code?如何在 Visual Studio Code 中使用 Remote-SSH 设置 ControlMaster?
【发布时间】:2019-10-24 11:44:59
【问题描述】:

我使用带有 Remote-SSH 扩展的 Visual-Studio-Code,我不想在登录后多次进行身份验证。所以我用 ssh_config 搜索 ControlMater 选项来设置。

连接后我收到以下错误消息。

无法连接到 Leo-OA:无法访问或无法访问 Linux x86_64(packet_write_poll:连接到 UNKNOWN 端口 -1:权限被拒绝)

我的环境:

Client:

    Visual Studio Code 1.35 Stable

    Windows 10 1803

Server: 

    Ubuntu 16.04 LTS

下面是我的设置文件

# Read more about SSH config files: https://linux.die.net/man/5/ssh_config
Host STONE-OA
    HostName 10.32.21.123
    User rock

Host Leo-OA
    HostName 10.32.21.123
    User root
    Port 60001

Host *
    ControlMaster auto
    ControlPath ~/.ssh/sockets/%r@%h-%p
    ControlPersist 600

我想知道主要问题是什么以及如何解决。谢谢大家。

【问题讨论】:

    标签: visual-studio-code vscode-remote ssh-config


    【解决方案1】:

    Windows 不支持此功能。 在没有 VS 代码的情况下,在 PowerShell 中使用 ControlMater 在 Windows 上简单地运行 ssh 也有问题。但是,您可以毫无问题地在 WSL 中使用 ControlMater。

    https://code.visualstudio.com/docs/remote/troubleshooting#_enabling-alternate-ssh-authentication-methods

    如果您使用 macOS 和 Linux 并希望减少输入密码或令牌的频率,您可以在本地计算机上启用 ControlMaster 功能,以便 OpenSSH 通过单个连接运行多个 SSH 会话。

    猜你喜欢
    • 2020-03-29
    • 2023-03-04
    • 2014-04-20
    • 2020-12-14
    • 2017-05-25
    • 2016-07-06
    • 1970-01-01
    • 2020-02-22
    • 2019-01-14
    相关资源
    最近更新 更多