An Illustrated Guide to SSH Agent Forwarding seems to suggest that your key never leaves the local machine agent.
It also states:
This does require the one-time installation of the user's public — not private! — keys on all the target machines, but this setup cost is rapidly recouped by the added productivity provided. Those using public keys with agent forwarding rarely go back.
The main pro and con of this (from that same page)
- Pro: Exceptional convenience
- Con: Requires installation of public (not private) keys on all target systems which can be inconvenient to begin with but after the first time is not a problem.
A Symantec page about ssh-agent seems to suggest the same, you have the ssh-agent running locally on your machine then the following applies:
How does the agent forwarding actually work? In short, the agent is running on one machine, and each time you SSH with agent forwarding, the server creates a 'tunnel' back through the SSH connection to the agent so it's available for any further SSH connections.
But as your communications are passed through another host it does rely on you implicitly trusting that intermediate host not to disclose data regarding the onward connection.
On the local system, it is important that the root user is trustworthy, because the root user can, amongst other things, just read the key file directly. On the remote system, if the ssh-agent connection is forwarded, it is also important that the root user is trustworthy, because they can access the agent socket (though not the key).