SSH ForwardAgent多跳

我一直在寻找一个解决scheme,在过去的2小时以下的问题,没有运气。

发展:

我正在使用公钥authentication来连接到我的服务器。 我使用ssh-agent转发为了不必pipe理公共/私有密钥。

假设我有服务器A, B and C

如果我从LOCAL ---> A ---> B连接,这个工作得很好。

它也工作得很好,如果我做LOCAL ---> A ---> C

现在,如果我尝试LOCAL ---> A ---> B ---> C ,SSH不能从B to C连接B to C

值得注意的是:我连接到服务器A作为stream动性,而我连接到服务器B作为根。 连接到服务器B作为stream动性解决了这个问题,但这不是我的select。

根据用户的build议,我每次使用ssh -A来确保代理转发已启用。

我发现了一个类似的问题,在这里没有答案: 是否有可能链接ssh代理转发通过多跳?

根据@Zoredache这里: https ://serverfault.com/a/561576/45671我只需​​要调整我的客户端configuration在每个中间系统。 我相信我做了。

要让代理转发工作通过多跳,只需要在每个中间系统上调整客户端configuration,以便代理转发。

这可能就像确保你的/etc/ssh/ssh_configconfiguration了一样。 但是如果你在~/.ssh/config有每个客户端的configuration,你可能也需要调整这些设置。

 Host * ForwardAgent yes 

您可以看到代理转发是否发生,或者如果您只是添加了-v选项,则发生错误。

 $ ssh -v issc@server1 OpenSSH_5.9p1 Debian-5ubuntu1.1, OpenSSL 1.0.1 14 Mar 2012 debug1: Reading configuration data /home/zoredache/.ssh/config ... debug1: Requesting authentication agent forwarding. debug1: Sending environment. Linux server1 3.11-0.bpo.2-amd64 #1 SMP Debian 3.11.8-1~bpo70+1 (2013-11-21) x86_64 The programs included with the Debian GNU/Linux system are free software; the exact distribution terms for each program are described in the individual files in /usr/share/doc/*/copyright. Debian GNU/Linux comes with ABSOLUTELY NO WARRANTY, to the extent permitted by applicable law. Last login: Sun Dec 15 20:39:44 2013 from 10.2.4.243 issc@server1:~$ 

同时validation你有一个有效的环境variables集。

 issc@server1:~$ export | grep SSH_AUTH declare -x SSH_AUTH_SOCK="/tmp/ssh-7VejOmKtNv/agent.57943"