I need to do port forwarding from an interactive ssh session, by which
I mean that I don't want the local ssh client to listen for a
connection, I just want ssh to take its input from stdin and set up
forwarding through the remote sshd.

Conceptually, what I want to be able to do is:

      ssh -L :remotehost:remoteport remoteviahost

Note that I've omitted the local port number from the -L option,
because, as I say, I want the ssh client to take stdin instead of
listening for a connnection.

I know that I could write some code to fire up ssh and have it listen
to some random port, and then make a local connection to that random
port.  But that means I'd hafta copy characters from stdin to the
local connection (and from the local connection to stdout), which is
overhead I'd really rather avoid.

Is there a way to accomplish this or do I need to teach ssh to do
this?

Thanks for any clues ...

Terry R. Friedrichsen

[EMAIL PROTECTED]

Reply via email to