我正在尝试从本地机器到一个称为群集的服务器使用一个名为中间服务器的ssh multihop。 根据http://sshmenu.sourceforge.net/articles/transparent-mulithop.html ,这是我做了〜/ .ssh / config:
Host merlot HostName merlot.stat.uconn.edu User vdeshpande Host cluster HostName stats.phys.uconn.edu User vdeshpande ProxyCommand ssh -q merlot nc -q0 cluster 22
当我在terminalinputssh cluster时,会提示input美乐的密码。 进入之后,我得到这个错误:
cluster: forward host lookup failed: Unknown host ssh_exchange_identification: Connection closed by remote host
我该如何解决? 我已经检查过,安装了nc。 另外,我可以ssh入美乐,然后ssh进入群集。
你有ProxyCommand错误。 如何处理它有两种方法:
首选方式是使用openssh本地开关-w :
ProxyCommand ssh -W %h:%p proxy
netcat版本看起来如此:
ProxyCommand ssh -q proxy nc %h %p
您不能在远程netcat命令中使用别名,因为它不知道它们。 伟大的指南是replace%h ,这是您在上面指定的HostName 。
所以你的情况:
ProxyCommand ssh -q merlot nc -q0 %h 22