小编Jac*_*cek的帖子

Windows 上的 OpenSSH 配置文件 - ProxyCommand 不起作用

我正在尝试在 Windows 上使用 OpenSSH ProxyCommand 通过 device1 连接到 device2。Device2 请求 xxxxx 端口转发和连接,无需 ProxyCommand,工作正常(但需要首先连接到 device1,然后连接到 device2,我想要简单的一步连接)。

我创建了 C:\Program Files\OpenSSH\etc\ssh_config 文件,如下所示:

Host device1
Hostname xxx.xxx.xx.xx
User root

Host device2
ProxyCommand ssh -q device1 nc -q0 localhost xxxxx
Run Code Online (Sandbox Code Playgroud)

现在当我打字时

ssh user@device2
Run Code Online (Sandbox Code Playgroud)

我明白了

/bin/sh: No such file or directory
write: Broken pipe
Run Code Online (Sandbox Code Playgroud)

我已经在 Linux 操作系统上检查过了,它工作得很好。你能解释一下我可能错在哪里吗?

此外,我还尝试在 C:\Program Files\OpenSSH\home\user\.ssh\config 中创建配置并得到相同的结果。

当我删除配置文件时,我得到

ssh: Could not resolve hostname device2: Name or service not known
Run Code Online (Sandbox Code Playgroud)

所以该文件似乎已被检测到。

我使用的是 OpenSSH_7.6p1、OpenSSL 1.0.2k 2017 年 1 月 26 日和 Windows 10

windows ssh port-forwarding openssh remote-access

5
推荐指数
2
解决办法
2万
查看次数

标签 统计

openssh ×1

port-forwarding ×1

remote-access ×1

ssh ×1

windows ×1