create/update 'How to kill an unresponsive SSH session.md' file

This commit is contained in:
anonymous
2023-04-25 22:06:01 -04:00
parent cc09de6015
commit d47301e3c5

View File

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