ymnk / jsch-agent-proxy

Other
70 stars 41 forks source link

TrileadWithAgentProxy doesn't work #16

Closed pyotr777 closed 10 years ago

pyotr777 commented 10 years ago

I have set up SSH login with agent proxy from my desktop (A) to host B, and from B to C.

When i type on A: ssh -A user@addressB and on B: ssh -A user@addressC it works OK: I can login to C.

Unfortunately, TrileadWithAgentProxy example does't work for me. Authentication from B to C fails, because Java is trying to find a key file on B, i.e. agent forwarding is not working.

All I get is:

mvn exec:java   -Dexec.mainClass="com.jcraft.jsch.agentproxy.examples.TrileadWithAgentProxy"   -Dexec.args="user@addressB date"
[INFO] Scanning for projects...
[INFO]                                                                         
[INFO] ------------------------------------------------------------------------
[INFO] Building examples to demonstrate how to use jsch-agent-proxy 0.0.7
[INFO] ------------------------------------------------------------------------
[INFO] 
[INFO] >>> exec-maven-plugin:1.2.1:java (default-cli) @ jsch.agentproxy.examples >>>
[INFO] 
[INFO] <<< exec-maven-plugin:1.2.1:java (default-cli) @ jsch.agentproxy.examples <<<
[INFO] 
[INFO] --- exec-maven-plugin:1.2.1:java (default-cli) @ jsch.agentproxy.examples ---

By the way, on host B I set up Force Command to automatically login to C, so typing ssh -A user@addressB takes me right to the host C.

Kind regards, Peter

ymnk commented 10 years ago

If you have succeeded to ssh from host A to host B with jsch-agent-proxy, it may not be a problem of jsch-agent-proxy. Does Trilead support the agent forwarding?

pyotr777 commented 10 years ago

Thank you, Yamanaka-san, for your answer. I have tried different examples as described here: https://github.com/ymnk/jsch-agent-proxy. JSchWithAgentProxy worked, SshjWithAgentProxy failed, TrileadWithAgentProxy failed.

I get no errors while compiling examples. I suppose you did some testing before placing examples in Readme. What are the SSH settings these examples are supposed to work with?

Kind regards, Peter

ymnk commented 10 years ago

SshjWithAgentProxy failed, TrileadWithAgentProxy failed.

What kind of failures do you have? Have you failed to ssh from host A to host B with jsch-agent-proxy?

pyotr777 commented 10 years ago

It fails to connect from B to C. I've put maven output for TrileadWithAgentProxy example in the first post. Agent forwarding is not working. Here is SSH output:

debug1: Authentications that can continue: publickey,password
debug1: Next authentication method: publickey
debug1: Trying private key: /home/user/.ssh/id_rsa
debug1: Trying private key: /home/user/.ssh/id_dsa
debug1: Trying private key: /home/user/.ssh/id_ecdsa
debug1: Next authentication method: password
debug1: read_passphrase: can't open /dev/tty: No such device or address
debug1: Authentications that can continue: publickey,password
Permission denied, please try again.
debug1: read_passphrase: can't open /dev/tty: No such device or address
debug1: Authentications that can continue: publickey,password
Permission denied, please try again.
debug1: read_passphrase: can't open /dev/tty: No such device or address
debug1: Authentications that can continue: publickey,password
debug1: No more authentication methods to try.
Permission denied (publickey,password).

This output is produced on host B, when connecting to host C. Does this mean Trilead and Sshj do not support agent forwarding?

ymnk commented 10 years ago

Does this mean Trilead and Sshj do not support agent forwarding?

We don't know about those libraries. Those examples demonstrate how to use them with jsch-agent-proxy, and examples are not for the agent forwarding.