Feature Request: Implement Cancel Socket/Port Forwarding
The Session::request_port_forwarding documentation states the following:
Currently, there is no way of stopping a port forwarding due to the fact that openssh multiplex server/master does not support this.
In ssh, you can cancel port forwarding for multiplexed connections like this:
ssh -S [path_to_multiplexing_socket] -O cancel -L/R [forwarding_addresses]
So I don't see why this couldn't be implemented? Maybe I'm missing something. Will implement it myself if no one picks up the ticket or tells me why it won't work. :)
I didn't support this mainly because the ssh mux doc told me so:
Note: currently unimplemented (server will always reply with MUX_S_FAILURE).
Perhaps the doc is out of date and it's actually supported.
Maybe I'm missing something. Will implement it myself if no one picks up the ticket or tells me why it won't work. :)
I will appreciate that! Please do submit a PR since openssh-mux-client is now in the development stage of a new crate openssh-proxy-client that is blocking on tokio-util and I'm been quite busy recently.
Oh I see! I think that comment in the doc you linked is outdated, I implemented it locally for me and it seems to work. I'll explicitly confirm that it works & figure out what my employers open source policy is, then I'll create a PR!
Hi @benlcb, sorry for bumping an old thread, but I ran into this need as well.
The doc mentioning that cancellation is currently not implemented was indeed outdated and was removed: https://github.com/openssh/openssh-portable/pull/442
If open-sourcing didn't really work out, could you perhaps describe the necessary changes at a high-level? I'm interested in contributing this feature.