。
我正在尝试设置SSH代理转发多个跳。我的本地机器是Windows,带有putty和pageant,所有的Linux机器都是Debian 7。
问题是,我的私钥,源自窗口,只工作在第一跳。添加到任何第一台机器上的私钥在任何地方都能工作。
第一个跳机称为‘vpn1 1’,第二个是‘www1 1’。“vpn1”连接到internet和intranet(10.1.0.1)。'www1‘只连接到内部网(10.1.0.10)。'vpn1‘添加键(enbyted@vpn1.enbyted.org)使用'ssh-add',这个键显示在选美中。
我在ssh-add -L中看到了所有三个键:
ssh-rsa [pubkey-1] git@home.enbyted.org //This is github key originating from Windows
ssh-rsa [pubkey-2] enbyted@home.robotronika.pl //This is SSH key originating from Windows
ssh-rsa [pubkey-3] enbyted@vpn1.enbyted.org //This is SSH key originating from 'vpn1'当我试图从‘ssh -v -T git@github.com’vpn1开始
debug1: Authentications that can continue: publickey
debug1: Next authentication method: publickey
debug1: Offering RSA public key: git@home.enbyted.org
debug1: Server accepts key: pkalg ssh-rsa blen 277
debug1: Authentication succeeded (publickey).当我试图从‘ssh -v -T git@github.com’www1开始
debug1: Authentications that can continue: publickey,password
debug1: Next authentication method: publickey
debug1: Offering RSA public key: git@home.enbyted.org
debug1: Authentications that can continue: publickey,password
debug1: Offering RSA public key: enbyted@home.robotronika.pl
debug1: Authentications that can continue: publickey,password
debug1: Offering RSA public key: enbyted@vpn1.enbyted.org
debug1: Authentications that can continue: publickey,password
debug1: Offering RSA public key: /home/enbyted/.ssh/id_rsa
debug1: Authentications that can continue: publickey,password
debug1: Trying private key: /home/enbyted/.ssh/id_dsa
debug1: Trying private key: /home/enbyted/.ssh/id_ecdsa
debug1: Next authentication method: password对于只接受'enbyted@home.robotronika.pl‘密钥的主机,ssh也是如此。但是,我可以使用'enbyted@vpn1.enbyted.org‘使用任意多个跳数来实现SSH。当然,git命令也是如此。
我的~/.ssh/config (在所有服务器上相同):
Host 10.1.0.*
ForwardAgent yes
Host *
ForwardAgent no我的/etc/ssh/sshd_config (没有注释,在所有服务器上相同):
Port <custom-port>
Protocol 2
HostKey /etc/ssh/ssh_host_rsa_key
HostKey /etc/ssh/ssh_host_dsa_key
HostKey /etc/ssh/ssh_host_ecdsa_key
UsePrivilegeSeparation yes
KeyRegenerationInterval 3600
ServerKeyBits 768
SyslogFacility AUTH
LogLevel INFO
LoginGraceTime 120
PermitRootLogin no
StrictModes yes
RSAAuthentication yes
PubkeyAuthentication yes
IgnoreRhosts yes
RhostsRSAAuthentication no
HostbasedAuthentication no
PermitEmptyPasswords no
ChallengeResponseAuthentication no
X11Forwarding yes
X11DisplayOffset 10
PrintMotd no
PrintLastLog yes
TCPKeepAlive yes
AcceptEnv LANG LC_*
Subsystem sftp /usr/lib/openssh/sftp-server
UsePAM yes另外,奇怪的是,在“www1”github上提供了两种方式-密码和公开密钥.我确信'www1‘SSHing到github.com是连接到与’vpn1 1‘相同的服务器。
上的网络设置
请注意,该图像来自文章,但很大程度上显示了我的设置。

所以,我在家里的PC上有两个键,在ruapehu (vpn1)上有一个键。
当我SSH到ruapehu从家里的个人电脑,我可以使用所有三个键只是很好。但是当我从ruapehu (vpn1)到aoraki (www1)执行另一个ssh时,我只能使用ruapehu的键。
当我从奥拉基(www1)用任何数量的跳到下面的任何主机时,只有ruapehu工作的键。
如果家用PC是带有Putty + pageant的Windows或带有ssh-agent的Linux的话,情况就不是这样。
发布于 2014-03-22 19:26:00
我认为您的问题在于PuTTY的配置。需要检查这个转发设置,如下所示:

https://unix.stackexchange.com/questions/120949
复制相似问题