Skip to content

How can I close a frozen SSH session?

As previously posted by Infertux here, a frozen SSH session when moving between networks is a common annoyance for anyone who works on remote servers. Thankfully there’s a quick fix (and a whole set of interesting commands) of which I wasn’t previously aware. These SSH escape sequences allow you to control the SSH client and gracefully disconnect, rather than closing terminals or killing processes. The specific incantation is as follows:

  1. [enter]
  2. ~
  3. .


And then viola! your SSH disconnects and you’re back to your local shell. ~? will list the other escape sequences – see link above for more details.