PuTTY 配置相当于 OpenSSH ProxyCommand [英] PuTTY configuration equivalent to OpenSSH ProxyCommand
问题描述
我只是想使用 PuTTY 与我的服务器建立 SSH 连接.这些服务器仅允许来自另一个特定服务器(以下示例中的MySshProxyingServer")的传入 SSH 连接.
在 Linux 上使用 ssh -W
命令没有问题.
在 PuTTY 中,我找不到创建此类连接的选项.
Linux 下的例子(~/.ssh/config
):
Host MyHostToConnectTo主机名 xx.xx.xx.xx用户根身份文件 ~/.ssh/id_rsaProxyCommand ssh MySshProxyServer -W %h:%p
有人知道如何在 PuTTY 中使用这样的配置吗?
PuTTY 中的等价物是本地代理命令".您可以使用
本地代理命令"是:
plink.exe %user@%proxyhost -P %proxyport -nc %host:%port
<小时>
另一种方法是首先使用 PuTTY(或 Plink)的另一个实例通过MySshProxyServer"打开隧道.
参见示例:
- 如何在 Windows 中使用 PuTTY 创建 SSH 隧道?
- 我的隧道 SFTP/SCP 会话指南.它适用于 WinSCP,但只需在通过隧道连接部分中使用 PuTTY 而不是 WinSCP.
I'm just trying to use PuTTY to get an SSH connection to my servers. These servers allow incoming SSH connection only from another specific server ("MySshProxyingServer" in example below).
Using Linux this is no problem with the ssh -W
command.
In PuTTY I can't find the options to create such a connection.
Example under Linux (~/.ssh/config
):
Host MyHostToConnectTo
Hostname xx.xx.xx.xx
User root
Identityfile ~/.ssh/id_rsa
ProxyCommand ssh MySshProxyServer -W %h:%p
Anyone knows how to use such a config in PuTTY?
The equivalent in PuTTY is "local proxy command". You can use the plink.exe
with the -nc
switch instead of the ssh
with the -W
switch:
The "local proxy command" is:
plink.exe %user@%proxyhost -P %proxyport -nc %host:%port
An alternative is to open a tunnel via the "MySshProxyServer" first using another instance of PuTTY (or Plink).
See for example:
- How to create SSH tunnel using PuTTY in Windows?
- My guide for tunneling SFTP/SCP session. It's for WinSCP, but just use PuTTY instead of WinSCP in section Connecting through the tunnel.
这篇关于PuTTY 配置相当于 OpenSSH ProxyCommand的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!