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.)

This entry was posted in Linux. Bookmark the permalink.

Leave a Reply

Your email address will not be published. Required fields are marked *

*

You may use these HTML tags and attributes: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong> <pre lang="" line="" escaped="">