Libssh2 agent redirect not working

I am using a library libssh2

for ssh connections in my mobile app. This is where I want to use support Agent Forwarding

.

I followed the same procedure as in the LibSSH2 Forwarding example shown here .

I can create the agent successfully, but when I try to connect it using libssh2_agent_connect(agent)

it gives me a -39 error LIBSSH2_ERROR_BAD_USE

.

Well, I am testing the same using MAC OSX terminal and it works fine. Please suggest if anything is wrong,

What am I doing:

  • I have machine A, MAchine B, Machine C.
  • I create a default RSA key by default in Machine A, add this key to the agent on machine A, I can show the added identity with the agent too.
  • Copying the public key (created on machine A and added on the agent) to Machine B and Machine C. Now I can ssh to Machine B and Machine C without entering that key's passphrase.

Does this mean that agent redirection is working correctly? Please suggest me if anything is wrong in the thread above. I'm very new to ssh if it's obvious.

I am doing the same with libssh2 by establishing a connection to machine B with the same key copied to machine B. Please, do I suggest I skip something with the libssh2 lib for redirection?

Thank!

+3


source to share


1 answer


LibSSH2 does not currently support agent redirection. There is an open request for this function .



The example above is for standard SSH agent authentication, no forwarding.

+1


source







All Articles