Subject: Re: Getting no identities from ssh-agent

Re: Getting no identities from ssh-agent

From: Peter Stuge <>
Date: Fri, 4 May 2012 03:14:34 +0200

Seth Willits wrote:
> When I run the ssh2_agent.c example on the site,

The agent example hasn't changed much lately but I would recommend to
always test using the very latest libssh2.git code.

> I always get 0 entities back from libssh2_agent_list_identities /
> libssh2_agent_get_identity. I am pretty certain ssh-agent works
> fine on my system because it's used by other programs to do ssh
> connections.
> Any ideas how can I figure out what's going on?


ssh-add -l

See if the above lists your identities.

Then run:

ktrace ssh-add -l && ktruss

and compare the output with

ktrace ssh2_agent && ktruss

> (Running OS X 10.7)

Note that SSH identities may be magically managed by Keychain on OS X
and so far noone has contributed Keychain support to libssh2. If you
need it you'll have to code it.

If ssh-add -l works then you can of course try to extract any
Keychain patches for OpenSSH from Apple and rework them into libssh2
changes. That would be cool!

Received on 2012-05-04