I'm using JSch 0.1.45 to connect to a remote machine running Debian
GNU/Linux with OpenSSH (OpenSSH_5.5p1 Debian-6+squeeze1, OpenSSL 0.9.8o
01 Jun 2010).
I enable agent forwarding by calling channel.setAgentForwarding(true)
and connected to the remote side by public key. So far, everything works
But when I execute "ssh-add -l" on the remote side, JSch runs through
ChannelAgentForwarding#write with typ = 1
(SSH_AGENTC_REQUEST_RSA_IDENTITIES) and produces no output. That causes
ssh-add to freeze and it must be killed manually.
Since forwarding the key works when I execute "ssh remotehost2" this is
not a very big problem, but it would be nice to get a proper output from
I tried a little hack to answer the SSH_AGENTC_REQUEST_RSA_IDENTITIES
request with 0 keys. The next request is SSH2_AGENTC_REQUEST_IDENTITIES
and this one is processed correctly. The patch is included. This enables
ssh-add to list all known keys.
I don't know if you plan to support more key-agent features, but it
would be relly nice :-)
Thank you for your feedback,
+-From: Jochen Wierum <jochen@...> --
|_Date: Sun, 11 Dec 2011 16:18:57 +0100 _________
|But when I execute "ssh-add -l" on the remote side, JSch runs through
|ChannelAgentForwarding#write with typ = 1
|(SSH_AGENTC_REQUEST_RSA_IDENTITIES) and produces no output. That causes
|ssh-add to freeze and it must be killed manually.
I had not tried 'ssh-add 'command on the remote.
Yes, it should not be freezed.
We'll will modify code to allow "ssh-add -d", "ssh-add -D" and
"ssh-add ~/.ssh/id_rsa", etc., on the remote.
1-14-20 HONCHO AOBA-KU,
SENDAI, MIYAGI 980-0014 Japan.