[Fwd: Re: Local tunneling question]

Andre Charbonneau <[email protected]>
Newsgroups gmane.comp.java.sshtools.user
Message-ID <[email protected]>

-------- Original Message --------
Subject: 	Re: [Sshtools-users] Local tunneling question
Date: 	Wed, 16 May 2007 11:25:03 -0400
From: 	Andre Charbonneau <[email protected]>
To: 	Sascha Hunold <[email protected]>
References: 	<[email protected]> 
<[email protected]>



Sascha Hunold wrote:
> Andre Charbonneau wrote:
>   
>>       // Create a tunnel for the VNC traffic.
>>         ForwardingClient forwarding = ssh.getForwardingClient();
>>         forwarding.addLocalForwarding("VNC", "0.0.0.0", 5920, 
>> "localhost", 5920);
>>         forwarding.startLocalForwarding("VNC");
>>       System.out.println("VNC tunnel started.");
>>       
>>         // And also open a shell to see what's going on...
>>         SessionChannelClient session=ssh.openSessionChannel();
>>         if (!session.requestPseudoTerminal("vt100",80,24,0,0,""))
>>           System.out.println("Failed to allocate a pseudo terminal");
>>         if (session.startShell())
>>         {
>>           InputStream in=session.getInputStream();
>>           OutputStream out=session.getOutputStream();
>>           IOStreamConnector input=new IOStreamConnector(System.in,out);
>>           IOStreamConnector output=new IOStreamConnector(in,System.out);
>>           output.getState().waitForState(IOStreamConnectorState.CLOSED);
>>         }
>>
>>
>> My tightvnc server is listening on a.b.c:5920.
>>   
>>     
>
> I think you will need remote forwarding as well.
>
> The problem is then that 5920 is not free on the remote side. So, I
> think you will have to change the send port of tightvnc (if it is 5920).
>
> And that's just my guess (I have successfully done tunneling with
> SSHTools but it was years ago).
>
> It is much easier to use the openssh binaries for testing and to do some
> experiments to find the correct port configuration.
>   
When I use openssh, I do the following to start the VNC server on a.b.c, 
setup the tunnel between my desktop system and a.b.c and then start the 
VNC viewer:

On a.b.c:
   Xvnc :20 -localhost

On my desktop:

   ssh -l spgrid -L 5920:127.0.0.1:5920 a.b.c
   xvncviewer localhost::5920

This is what I'm trying to replicate using the sshtools libraries to 
create the SSH tunnel.

Regards,
   Andre



-------------------------------------------------------------------------
This SF.net email is sponsored by DB2 Express
Download DB2 Express C - the FREE version of DB2 express and take
control of your XML. No limits. Just data. Click to get it now.
http://sourceforge.net/powerbar/db2/
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.