If I ssh to a remote machine and then lose internet connectivity, the session freezes.
I can't control-c or otherwise abort and go back to my local xterm or terminal prompt but if I wait several minutes it will do so.
There must be some way to force it to abort the remote ssh session when connectivity is lost.
I'm on a Mac but I believe this happens on cygwin or linux as well.
Linux – ssh sessions in xterms freeze for many minutes whenever they disconnect
cygwin;linuxmacossshterminal
Best Answer
Tilda period should do what you want (
~.
). It must be the first thing typed after pressing enter, so press enter and then type it. Here is the manual entry for ssh:ctrl-d might also work.
Edit: SSH has a lot of escape character commands built in. With an active SSH session open you can press [enter]~? to see a list of options. This is all in the man entry for ssh. If you don't already know about man entries... you will discover a world of amazingness! In the linux terminal type "man command" in this case "man ssh" without the quotes. It has lots of information. Press "q" to quit. You can also type "info ssh" if you like the info interface better.