Thanks a lot Atsuhiko.

I tested it out. it works well! :)


On Mon, Mar 10, 2014 at 7:49 PM, Atsuhiko Yamanaka <y...@jcraft.com> wrote:

> Hi,
>
>    +-From: Sachith Withana <swsach...@gmail.com> --
>    |_Date: Mon, 10 Mar 2014 10:53:54 -0400 ________
>    |
>    |Does JSCH support SSH key forwarding capability?
>
> Yes, it does.
>
>     JSch jsch = new JSch();
>     jsch.addIdentity("/home/foo/.ssh/id_rsa"
>                      // , "passphrase"
>                     );
>     ...
>     Channel channel=session.openChannel("shell");
>     ((ChannelShell)channel).setAgentForwarding(true);
>     ...
>     channel.connect();
>
> By using jsch-agent-proxy[1], you don't have to handle
> the private-key file by yourself.  You can use ssh-agent or Pageant as you
> have done usually on the terminal.  Refer to its example[2].
>
> [1] http://www.jcraft.com/jsch-agent-proxy/
> [2]
> https://github.com/ymnk/jsch-agent-proxy/blob/master/examples/src/main/java/com/jcraft/jsch/agentproxy/examples/JSchWithAgentProxy.java
>
>
> Sincerely,
> --
> Atsuhiko Yamanaka
> JCraft,Inc.
> 1-14-20 HONCHO AOBA-KU,
> SENDAI, MIYAGI 980-0014 Japan.
> Tel +81-22-723-2150
> Skype callto://jcraft/
> Twitter: http://twitter.com/ymnk
> Facebook: http://facebook.com/aymnk
>



-- 
Thanks,
Sachith Withana
------------------------------------------------------------------------------
Learn Graph Databases - Download FREE O'Reilly Book
"Graph Databases" is the definitive new guide to graph databases and their
applications. Written by three acclaimed leaders in the field,
this first edition is now available. Download your free book today!
http://p.sf.net/sfu/13534_NeoTech
_______________________________________________
JSch-users mailing list
JSch-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/jsch-users

Reply via email to