Я могу ssh из hostA в hostB и из hostA в hostC используя ключи, загруженные в ssh-agent, без каких-либо проблем. Однако, если я выполняю ssh -A hostB с hostA , то пробую ssh hostC с hostB , аутентификация с открытым ключом не работает и запрашивает мой пароль.
Некоторые детали:
- Я использую
ssh-agentкоторый поставляется с OpenSSH, а не GNOME Keyring или что-то подобное. Как
ssh -v hostBизhostAиssh -v hostCизhostAпоказывают:debug1: Next authentication method: publickey debug1: Offering RSA public key: /home/rhansen/.ssh/id_rsa debug1: Server accepts key: pkalg ssh-rsa blen 279 debug1: Authentication succeeded (publickey).Я вижу свой ключ, когда запускаю
ssh-add -LнаhostB.- Мой ключ на
hostAзащищен паролем. - На
hostB,/etc/ssh/sshd_configНЕ содержитAllowAgentForwarding no. - Все три системы работают под управлением Ubuntu 15.10 (Wily) с OpenSSH 6.6.1p1.
Когда я запускаю
ssh -vvv hostCизhostB, регистрируется следующее:... debug2: key: /home/rhansen/.ssh/id_rsa ((nil)), debug2: key: /home/rhansen/.ssh/id_dsa ((nil)), debug2: key: /home/rhansen/.ssh/id_ecdsa ((nil)), debug2: key: /home/rhansen/.ssh/id_ed25519 ((nil)), debug1: Authentications that can continue: publickey,password debug3: start over, passed a different list publickey,password debug3: preferred gssapi-keyex,gssapi-with-mic,publickey,keyboard-interactive,password debug3: authmethod_lookup publickey debug3: remaining preferred: keyboard-interactive,password debug3: authmethod_is_enabled publickey debug1: Next authentication method: publickey debug1: Trying private key: /home/rhansen/.ssh/id_rsa debug3: no such identity: /home/rhansen/.ssh/id_rsa: No such file or directory debug1: Trying private key: /home/rhansen/.ssh/id_dsa debug3: no such identity: /home/rhansen/.ssh/id_dsa: No such file or directory debug1: Trying private key: /home/rhansen/.ssh/id_ecdsa debug3: no such identity: /home/rhansen/.ssh/id_ecdsa: No such file or directory debug1: Trying private key: /home/rhansen/.ssh/id_ed25519 debug3: no such identity: /home/rhansen/.ssh/id_ed25519: No such file or directory debug2: we did not send a packet, disable method debug3: authmethod_lookup password debug3: remaining preferred: ,password debug3: authmethod_is_enabled password debug1: Next authentication method: passwordЕсли я выполняю
ssh -vvv hostBсhostA, а затем выполняюssh hostC, hostA регистрируетhostAперед запросом пароляhostC:debug1: client_input_channel_open: ctype auth-agent@openssh.com rchan 2 win 65536 max 16384 debug2: fd 10 setting O_NONBLOCK debug3: fd 10 is O_NONBLOCK debug1: channel 2: new [authentication agent connection] debug1: confirm auth-agent@openssh.comМой
~/.ssh/configво всех системах содержит следующие необычные настройки (плюс некоторые общие, которые я не считаю актуальными):ControlMaster auto ProxyCommand sh ~/.ssh/proxy.sh '%h' '%p' '%r' IdentitiesOnly yes
Есть идеи?
