. one after the other to disconnect from a frozen session. Simple but effective.
This works because these are escape sequences. Next time you SSH somewhere just type
? (tilde, then question mark) to see all the options.
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 (SSH protocol 2 only)
~^Z - suspend ssh
~# - list forwarded connections
~& - background ssh (when waiting for connections to terminate)
~? - this message
~~ - send the escape character by typing it twice