3 ms·
If you forward an agent, that doesn't actually provide access to the private key. It provides access to the public key, as well as access to key operations tha
by JoshTriplett 12y ago
If you forward an agent, that doesn't actually provide access to the private key. It provides access to the public key, as well as access to key operations that would allow authenticating to a server using the private key (such as SSH2_AGENTC_SIGN_REQUEST), but it doesn't actually expose the private key for future operations after you stop forwarding the agent.
The interaction shown in the "Having fun with an agent" section of the article shows the agent providing the public key and name, not the private key.
See the ssh-agent protocol for details: http://api.libssh.org/rfc/PROTOCOL.agent http://api.libssh.org/rfc/PROTOCOL.agent
You still should never forward your SSH agent to a system you don't trust. However, if someone compromises such a system, they have not necessarily compromised your SSH private key, though they may have used your agent to access systems you have access to while you were forwarding the agent.
- caf 12y agoAs the article points out though, they may have used that temporary access to your systems to leverage more permanent access. (And of course if the machine you're connecting from has an sshd listening then there's a good chance they could successfully connect back to it using your agent forwarding, then subvert the agent itself)
- jamiesonbecker 12y agoExactly. Public keys are by definition public so they can be spread freely all over. Forwarding will never compromise your private key. Of course, as you point out, if you forward THROUGH a compromised system, someone could hop on the key forwarding and come along for the ride. And, as another commenter pointed out, they could always hijack your access on the final system to create their own user accounts. And also why a good SSH key manager like https://Userify.com https://Userify.com to distribute your public key can make forwarding easier.