Using -Ocancel on dynamically allocated ports

Sean Patrick Santos quantheory at gmail.com
Sat Mar 29 03:55:00 EST 2014


Greetings,

So, the typical use of -Ocancel is quite straightforward:

> ssh -Oforward -R 12345:127.0.0.1:56789 user at remote
> ssh -Ocancel -R 12345:127.0.0.1:56789 user at remote

But this is not so good:

> ssh -Oforward -R 0:127.0.0.1:56789 user at remote
Allocated port 12345 for remote forward to 127.0.0.1:56789
12345
> ssh -Ocancel -R 0:127.0.0.1:56789 user at remote
mux_client_forward: forwarding request failed: port not in permitted opens
muxclient: master cancel forward request failed
> ssh -Ocancel -R 12345:127.0.0.1:56789 user at remote
mux_client_forward: forwarding request failed: port not forwarded
muxclient: master cancel forward request failed

I'm not sure whether this is a "bug" or not, because I really don't
understand what the intended behavior is. But I think that at least in
the second case, where you know what port is allocated, using -Ocancel
should work to cancel the forwarding request.

-Sean Patrick Santos


More information about the openssh-unix-dev mailing list