Use SSH's escape sequence <enter>~<shift>+c
user@sshhost $ ~C
ssh> L8080:localhost:8080
Forwarding port.
user@sshhost $ ~C
ssh> KL8080
Canceled forwarding.
If you are connected through multiple nested SSH connections, you can choose to modify the next deeper nested connection by adding one more ~ escape character.
Supported escape sequences:
~.
- terminate connection (and any multiplexed sessions)
~B
- send a BREAK to the remote system
~C
- open a command line
~R
- request rekey
~V/v
- decrease/increase verbosity (LogLevel)
~^Z
- suspend ssh
~#
- list forwarded connections
~&
- background ssh (when waiting for connections to terminate)
~?
- this message
~~
- send the escape character by typing it twice