But there is an escape sequence that will allow me to terminate the current SSH session. Hitting the three keys listed below will allow me to terminate the session.
↲ Enter, ~, .
I.e., hitting the Enter key then the
tilde, aka
"squiqqle" character, which is obtained by hitting the Shift key
and then the key with `
and ~
on it, then the key
with the period on it.
You can see the other escape sequences available to you in an SSH session by typing ~?, i.e., the tilde and then question mark key. They are shown below:
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.)
You need to hit the Enter key before hitting the other keys, i.e.,
the escape sequences are only recognized after a
newline.
If you wish to return to what you were doing after viewing the above
escape sequences by using ~?
, simply hit the Enter key.