Hi,

   +-From: Andre Charbonneau <[EMAIL PROTECTED]> --
   |_Date: Fri, 24 Aug 2007 13:39:56 -0400 _______________________
   |
   |system (or gateway system as I often call it).  For example:
   |User's Desktop  -----------> middle.system -------------> remote.system
   |What I do for ssh is that I connect to the middle system and then create
   |a ssh tunnel from the user's desktop to the remote system.  This works well.
   ...
   |                     Has someone managed to implement something like
   |this before and could maybe give me some pointers on how to do this?

  Session session1=jsch.getSession(user1, "middle.system");
  ...
  session1.connect();
  int assinged_port=session1.setPortForwardingL(0, "remote.system", 22);

  Session session2=jsch.getSession(user2, "127.0.0.1", assinged_port);
  ... 
  session2.connect();

  Channel channel=session2.openChannel("sftp");
  channel.connect();
  ChannelSftp c=(ChannelSftp)channel;


Sincerely,
--
Atsuhiko Yamanaka
JCraft,Inc.
1-14-20 HONCHO AOBA-KU,
SENDAI, MIYAGI 980-0014 Japan.
Tel +81-22-723-2150
    +1-415-578-3454
Fax +81-22-224-8773
Skype callto://jcraft/

-------------------------------------------------------------------------
This SF.net email is sponsored by: Splunk Inc.
Still grepping through log files to find problems?  Stop.
Now Search log events and configuration files using AJAX and a browser.
Download your FREE copy of Splunk now >>  http://get.splunk.com/
_______________________________________________
JSch-users mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/jsch-users

Reply via email to