ssh: Escape sequences
ssh
supports a small number of control commands via an escape sequence. This is helpful if a session hangs (e.g. dropped connection) and becomes non-responsive; the escape codes can be used to kill it immediately.
The sequences all start with the escape character, which is a tilde, ~
, by default but can be specified with EscapeChar
or -e
options:
~.
- kill the session~?
- list all escape sequences- etc.
Note that these only work immediately following a newline, so it helps to prefix all of those with Enter
i.e. <Enter>~.
etc.
Read more in the manual: man ssh | less '+/^ESCAPE CHARACTERS'
Published on: 28 Jul 2025