Mailing List Archive

Manipulating Forwards on an existing shell
Hey,

Is there any way at all to manipulate local forwards on an existing
shell? I basically have a script which I run to setup a bunch of port
forwards to create a pseudo-VPN. It's much stabler through SSH than it
is through our PPTP VPN. So it would be nice to create a zenity script
to setup instant forwards without having to first close SSH and reopen
it. To establish the connection takes quite long due to the
authentication, where creating a new forward is almost instantaneous.
Further I will also not loose my existing connections.

My SSH version: OpenSSH_4.7p1 Debian-8ubuntu1.2, OpenSSL 0.9.8g 19 Oct 2007

It doesn't really matter if the only way to do it is dirty, because
I'm not really aiming at portability. It's mostly only for me to use
on my home machines.

Quintin Beukes
Re: Manipulating Forwards on an existing shell [ In reply to ]
Quintin Beukes wrote:
> Is there any way at all to manipulate local forwards on an existing
> shell?

Use the ~C escape, which is documented in ssh(1) thusly:

~C Open command line. Currently this allows the addition of port
forwardings using the -L, -R and -D options (see above). It also
allows the cancellation of existing remote port-forwardings using
-KR[bind_address:]port. !command allows the user to execute a
local command if the PermitLocalCommand option is enabled in
ssh_config(5). Basic help is available, using the -h option.

Depending on what you're doing, you may be better served by
-D/DynamicForward which allows you to use SOCKSified clients rather than
created new (local) forwards for each purpose.

--
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.
Re: Manipulating Forwards on an existing shell [ In reply to ]
I know -D (socks) and ~C (then -Lx:y:z), which is what I use
currently. And I have to use normal port forwards.

What I'm looking for is to make this easier with a zenity dialog at
the click of a button, then have to terminal pipe somewhere and become
a background process.

Is there perhaps some options I can supply to SSH so it accepts ~C
(then the options + \n) from stdin?

Quintin Beukes



On Tue, Oct 20, 2009 at 4:11 AM, Darren Tucker <dtucker@zip.com.au> wrote:
> Quintin Beukes wrote:
>>
>> Is there any way at all to manipulate local forwards on an existing
>> shell?
>
> Use the ~C escape, which is documented in ssh(1) thusly:
>
>  ~C   Open command line.  Currently this allows the addition of port
>      forwardings using the -L, -R and -D options (see above).  It also
>      allows the cancellation of existing remote port-forwardings using
>      -KR[bind_address:]port.  !command allows the user to execute a
>      local command if the PermitLocalCommand option is enabled in
>      ssh_config(5).  Basic help is available, using the -h option.
>
> Depending on what you're doing, you may be better served by
> -D/DynamicForward which allows you to use SOCKSified clients rather than
> created new (local) forwards for each purpose.
>
> --
> 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.
>