On Fri, Nov 16, 2012 at 12:10:19AM +0200, Manolis Tzanidakis wrote:
> Hello all,
> I want to send the '~C' escape to ssh followed by ie. '-L 1024:localhost:1024'
> from the active ssh connection's shell, non-interactively from a script.
> Is it possible? Or is there a better way to accomplish this?

If you start ssh with ControlMaster mode enabled you can use "ssh -O
forward" to add forwardings to an established connection, eg:

$ ssh -o ControlMaster=yes -o ControlPath=/tmp/ctl localhost

$ ssh -o ControlMaster=no -o ControlPath=/tmp/ctl -O forward \
    -L 1234:127.0.0.1:22 localhost

-- 
Darren Tucker (dtucker at zip.com.au)
GPG key 8FF4FA69 / D9A3 86E9 7EEE AF4B B2D4  37C9 C982 80C7 8FF4 FA69
    Good judgement comes with experience. Unfortunately, the experience
usually comes from bad judgement.

Reply via email to