Se os dois sistemas tiverem a chave pública do seu sistema local, use -A
.
De ssh(1)
-A Enables forwarding of the authentication agent connection. This can also be specified on a per-host basis in a configuration file.
Esteja ciente também desse aviso:
Agent forwarding should be enabled with caution. Users with the ability to bypass file permissions on the remote host (for the agent's UNIX-domain socket) can access the local agent through the forwarded connection. An attacker cannot obtain key material from the agent, however they can perform operations on the keys that enable them to authenticate using the identities loaded into the agent.
O resultado é que quando você autentica contra o segundo host, a autenticação é encaminhada de volta para o host em que você reside fisicamente.
Exemplo:
me@host0:~ $ ssh -A host1
Last login: Thu Jun 14 11:31:53 2012 from 2001:db8::b0
me@host1:~ $ ssh -A host2
Last login: Thu Jun 14 11:41:05 2012 from 2001:db8::b1
me@host3:~ $ ssh -A host3
Last login: Tue Jun 12 10:46:50 2012 from 2001:db8::b2
me@host3:~ $