Escaping SSH shell from dropped network connections

If you have ever been SSH’ed into a server when your network connection drops, you would have noticed that your shell terminal is completely locked up, you can’t even CTRL+C to get out of it. If you would like to save your terminal, you can with the following key sequence

[ENTER KEY]~ .

SSH has a few more key strokes you can use. To find out which ones are available type:
~?
it shoulld bring up this help output:

Supported escape sequences:
~. - terminate connection
~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
(Note that escapes are only recognized immediately after newline.)

Stumble it!

Leave a Reply

You must be logged in to post a comment.