Greetings,

I'm currently trying to tunnel some VNC traffic through SSH.

When I only have 2 systems, hostA and hostB, then I use the following
port forwarding method:

session = jsch.getSession("username", "hostB", 22);
session.connect();
assigned_port = session.setPortForwardingL(localPort, "127.0.0.1",
remotePort);

Then I can tunnel the VNC traffic without any problem.  (In my scenario
the VNC server is listenening on 'localhost' only, hence why I put
"127.0.0.1" in the setPortForwardingL method call above.  If I put
"hostB" instead, then the VNC server simply refuses the tunneled VNC
connections because it sees it as if it is comming from the IP of hostB
instead of '127.0.0.1'.)


Now let's suppose that, because of firewall issues, the traffic has to
go through a middle system, hostM.  If I create the tunnel using the
following method:

session = jsch.getSession("username", "hostM", 22);
session.connect();
assigned_port = session.setPortForwardingL(localPort, "hostB", remotePort);

then the tunnel seem to be successfully created, but my VNC server on
hostB will refuse connections because it thinks it is not comming from
'localhost', but from 'hostM' instead.


Anyone knows if there is there a way around this problem?
Maybe I'm doing something wrong in the way I call setPortForwardingL?


Thanks,
        Andre

-------------------------------------------------------------------------
This SF.net email is sponsored by: Microsoft
Defy all challenges. Microsoft(R) Visual Studio 2005.
http://clk.atdmt.com/MRT/go/vse0120000070mrt/direct/01/
_______________________________________________
JSch-users mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/jsch-users

Reply via email to