[PATCH] controlling remote port forwarding over control path

Torsten Foertsch torsten.foertsch at gmx.net
Sun Mar 6 01:26:16 EST 2005


On Friday 04 March 2005 23:10, Damien Miller wrote:
> However, instead of a commandline like:
>
>  >   ssh -S ~/.ssh/ctl -O add-rforward 2000:forward:80 localhost
>
> Which is not very getopt()ish. Could I suggest:
>
> ssh -S ~/.ssh/ctl -O add-rforward localhost 2000:forward:80
>
> (i.e. place the forarding arguments where the command goes normally)
>
> This has the advantage of being easier to extend to multiple
> forwarding specifications:
>
> ssh -S ~/.ssh/ctl -O add-rforward xxx 2222:host1:22 2223:host2:22 ...

Your variant makes it impossible to remove one channel and add another 
at the same time. I'd vote for

  ssh -S ~/.ssh/ctl -O add-rforward 2222:host1:22 \
                    -O cancel-rforward 2223:host2:22 xxx

Or even better, let's reuse -L, -R and -D. They are not very useful for 
control connections. -KL, -KR, -KD can then be used to stop forwarding.

Or

  ssh -S ~/.ssh/ctl -R 2222:host1:22 -R 2223:host2:22 \
                    -K \
                    -R 2222:host3:22 -R 2223:host4:22 xxx

first closes 2222:host3:22 and 2223:host4:22 and then opens 
2222:host1:22 and 2223:host2:22.

Thus, -K toggles add/removal mode. How about that?

I'd favor the last variant.

Torsten
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 189 bytes
Desc: not available
Url : http://lists.mindrot.org/pipermail/openssh-unix-dev/attachments/20050305/82e8437a/attachment.bin 


More information about the openssh-unix-dev mailing list