Ubuntu – Terminal ssh session freezes after waking from suspend

16.04gnome-terminalssh

Ubuntu 16.04.

My terminal freezes, as the title says. I know it's an ssh session, however I would expect only to drop me off, but the whole terminal freezes, no mouse nor keyboard input is possible.

Does anybody know a solution?

Best Answer

For the SSH escape sequences to work you need to be on a newline, so hit the RETURN key first.

Then usage of eg ~. (terminate connection) will work.

To see all supported escape sequences use ~? in a SSH session:

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
(Note that escapes are only recognized immediately after newline.)