我正在尝试在 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