Hi,
+-From: "Soren Olsen" <[EMAIL PROTECTED]> --
|_Date: Wed, 3 Oct 2007 09:56:59 +0200 ____
|
>> In putty its done like this:
>> ssh 10.0.0.1
>> ssh -L 1099:10.0.0.2:1098
>> ssh 10.0.0.2
>> ssh -L 1098:10.0.3:1099
|Can anyone tell me if this is possible?
I'm really confusing. At least, 'ssh -L 1099:10.0.0.2:1098'
is not a valid command and it seems that four hosts appears in
your example; 10.0.0.1, 10.0.0.2, 10.0.0.3, 127.0.0.1.
It is contradict what you wrote
>Is it possible to make a connection host A to host B, and then jump from
> host B to C, because A and C stays in two different networks
If you need the port forwarding TCP port 1099 on hostA to
TCP port 1099 on hostC, how about following,
On hostA
Session s1=jsch.getSession(user, "hostB", 22);
...
s1.connect();
s1.setPortForwardingL(1099, "hostC", 1099);
If you need the port forwarding TCP port 1099 on 127.0.0.1 to
TCP port 1099 on hostC via hostA and hostB , how about following,
On 127.0.0.1
Session s1=jsch.getSession(user, "hostA", 22);
...
s1.connect();
int p=s1.setPortForwardingL(0, "hostB", 22);
Session s2=jsch.getSession(user, "127.0.0.1", p);
s2.setHostKeyAlias("hostB");
...
s2.connect();
s2.setPortForwardingL(1099, "hostC", 1099);
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