I use connection muxing. I am logged into a remote server.

I decide I want to forward a local port. Login again:
ssh -L 1234:there:4321 there

Working. I decide I want to switch remote ports. I exit the above
shell. I login again.
ssh -L 1234:there:4444
mux_client_forward: forwarding request failed: Port forwarding failed
muxclient: master forward request failed
channel_setup_fwd_listener: cannot listen to port: 1234
Could not request local forwarding.
....

Indeed, the old port forwarding is still in effect. And I can't see a
way to stop it.

This would only be annoying if it just meant I couldn't reforward the
port, but I think it's worse than that. When I exit a port forwarding
ssh, I expect it to stop forwarding that port. Unbeknownst to me, the
temporary hole I punched in my network is really a semi-permanent hole.

I see in the ssh_config man page for ControlMaster that there is a note
about agent forwarding using the master connection. However, it's not
at all clear that this also applies to port forwarding. Also, it's not
clear that forwarding can be added later, but not disabled. Certainly,
the current behavior violates the principle of least surprise (for me).

Reply via email to