Subject: ssh-agent and keys

ssh-agent and keys

From: Ben Kibbey <>
Date: Sun, 4 Dec 2011 19:13:39 -0500

Hello folks,

I have a question about how to implement ssh-agent support in my
program. Am I supposed to iterate over libssh2_agent_get_identity() and
libssh2_agent_userauth() until a valid/correct key is found from the
agent? It seems insecure if the remote host was somehow compromised
since the SSH server may collect private keys for others hosts from the

Or maybe there is a way to obtain the public portion of the key from the
agent's private key and compare it with the remotes public key identity
before sending any private key data?

Thanks for any help,

Ben Kibbey
[XMPP: bjk AT jabber DOT org] - [IRC: (bjk) FreeNode/OFTC]
Received on 2011-12-05