ssh is one of the programs I didn't really every read the manpage of (only to lookup stuff which I already knew is possible but forgot how). However there are some nice features you miss if you don't. Besides
ControlMaster I just stumbled over another feature.
It is possible to add port forwarding on the fly without the need to open a new terminal and ssh connection.
ssh provides some
escape characters to do some stuff in your current connection.
In the default setup the basic escape character is
~ (you can specify this by using
EscapeChar in your configuration).
If you follow this by # character (and thus type
~#) you get a list of all forwarded connections.
Using
~C you can open an internal ssh shell that enables you to add and remove local/remote port forwardings
ssh> help
Commands:
-L[bind_address:]port:host:hostport Request local forward
-R[bind_address:]port:host:hostport Request remote forward
-KR[bind_address:]port Cancel remote forward
ssh> -L 8080:localhost:8080
Forwarding port.
echo foo
foo
Some other more or less usefull escape sequences, have a look at man 1 ssh -> ESCAPE CHARACTERS