Last Updated: July 28, 2022
·
2.253K
· nevir

Gracefully escape that zombie ssh session!

It's one of those days. You've got a SSH session that's hung and not responding.

Maybe you lost your connection. Maybe you closed your laptop's lid without thinking.

You could kill the ssh process or terminal tab, but that's just dirty!

Instead, remember this: [enter][~][.]

Boom. Connection closed; a terminal saved.

Curious?

~ is the default escape character for the OpenSSH client; and it's only recognized at the start of a line. Check out the ssh man page for more tips.

3 Responses
Add your response

How can I input [enter][~][.] ?

over 1 year ago ·

@jmzc oh, sorry it's not clear - those are the keystrokes you need to make. A newline followed by ~.

I'll update the post to clarify :)

over 1 year ago ·

OK. Thanks
I asked you because I do in a bash shell the next

~.

and nothing happens
I know that it's not a zombie session, but it should capture that command sequece
Maybe I'm wrong ...

over 1 year ago ·