[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: SSH reverse tunnel


On Thursday 24 September 2015 09:40:18 lars van ruiten wrote:
> Hi,
> Is there an example available of a fully function reverse SSH tunnel written
> in libssh? I need to set up a VNC server. The system should work like
> this:VNC client connects to a server on port 5907. That port needs to be
> redirected to port 5900 of a VNC server which can't be accessed directly
> due to the fact that it is part of a local network and is behind a NAT. So
> I'm trying to write a program that connects to the middleman-server and
> requests that it listens on port 5907 and redirects all that data to port
> 5900 on the local computer. Can someone give me an example of how to
> achieve this? The reverse port forwarding example in the tutorial handles
> the request by itself and I can't figure out how I should redirect the data
> to a local port.Any tips/advice/help would be really appreciated. An
> example program would be totally awesome. Cheerio

You connect() to localhost:5900

Then handle the the reverse channel ...

ssh_channel_read() -> send()
recv() -> ssh_channel_write()

-- 
Andreas Schneider                   GPG-ID: CC014E3D
www.cryptomilk.org                asn@xxxxxxxxxxxxxx

Follow-Ups:
RE: SSH reverse tunnellars van ruiten <larsvanruiten@xxxxxxxxxxx>
References:
SSH reverse tunnellars van ruiten <larsvanruiten@xxxxxxxxxxx>
Archive administrator: postmaster@lists.cynapses.org