What to do when ssh hangs in terminal

Published: 二 28 九月 2021
By jlz

In linux.

I use ssh a lot. And I met this situation nearly every day: after waking laptop from sleep, I found that I didn't exit ssh connection before I close laptop lid, the ssh connection now hangs there.

I know this escape sequence(~.) before, but sometimes I found it not working as expected. I happen to saw this today. From what the answer says, the escape character(~) has to be the first character of a line, so first hit "enter/return" key, then escape sequence(~.) should always work. I will test them later.

links

social