diff --git a/How to kill an unresponsive SSH session.md b/How to kill an unresponsive SSH session.md new file mode 100644 index 0000000..32de28a --- /dev/null +++ b/How to kill an unresponsive SSH session.md @@ -0,0 +1,36 @@ +# How to kill an unresponsive SSH session + +## Summary + +Lets say you're happily typing in your remote shell when all of sudden, the crappy Wi-Fi network you're using goes down. +You end up with a perfectly unusable frozen shell, ugh! + +To do that, assuming you lost connectivity, press in that order: + +```shell +[Enter] +~ +. +``` + +That is, **return** key then **tilde** then **period**. + +This will send an escape sequence to your local SSH client and terminate the connection. +So this will always work even without a network connection. + +Here's the list of escape sequences: + +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 + + +(Note that escapes are only recognized immediately after newline.) \ No newline at end of file