forwarding stdin/out to remote socket

Igor Bukanov igor.bukanov at
Mon May 2 22:14:25 EST 2005


Some vnc clients has '-via ssh_gateway' option to simplify the setup
of ssh port forwarding. Basically the option implements the following
3 steps:

1. Find local port available for listening.

2. Fork/exec ssh -L found_port:vnc_host:vnc_port ssh_gateway sleep some_delay

3. Connect to the found_port 

Although convenient the setup has its problems. First, it exposes the
remote vnc port for everybody on the localhost for the duration of
some_delay. Second it can cause connection at step 3 to fail if it
would take a long time for ssh to setup the forwarding.

Now all this can be avoided if vnc would simply use stdin/out from ssh
as a communication channel and make sure that ssh would forward the
remote port to it. Currently I did it using netpipes, , but it does
not seem right to execute an additional process copying megabytes of
tcp trafic from vncserver to stdin/out just so ssh can forward it one
more time.

So it would be nice if ssh can forward a port to stdin/out on its own.
AFAICS for ssh2 it  would require to modify only ssh client, right?

Regards, Igor

More information about the openssh-unix-dev mailing list