2

I often have SSH connections through Terminal that stop responding (like if I've left it overnight) but when I try to use the dead connection Terminal doesn't respond for several minutes until:

Write failed: Broken pipe

Is there a way I can tell bash to immediately disconnect (because I know the connection is dead) without closing/opening a new window?

4
  • Does CTRL+C not work for that?
    – anguiac7
    Commented Nov 26, 2014 at 5:16
  • Agreed. CTRL+C should work.
    – Jerry
    Commented Nov 26, 2014 at 11:15
  • Should of mentioned that CTRL+C and CTRL+D do not work. Commented Nov 26, 2014 at 23:21
  • Control characters only send a signal to the application to be handled by the application. If the connection is dead the character waits to be sent like any other character typed. Commented Nov 26, 2014 at 23:22

1 Answer 1

6

You can type

~.

which ends the SSH connection. Normally it works immediately, but sometimes you may need to do it a few times.

1
  • Worked perfectly first time for me :) Commented Nov 26, 2014 at 23:23

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .