Szenario: [A] –ssh–> [B] –ssh–> [C] Auf A ist der private Key vorhanden, der zum Login auf C genutzt werden soll. Unter Verwendung des ssh-agent kann das folgendermaßen geschehen:
A ~ $ eval $(ssh-agent) Agent pid 8513 A ~ $ ssh-add A ~ $ ssh -A user@B B ~ $ ssh user@C
Aber Achtung (entnommen aus der ssh manpage):
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.