PhpRiot
News Archive
PhpRiot Newsletter
Your Email Address:

More information

Killing a dead ssh connection

Note: This article was originally published at Planet PHP on 25 September 2010.
Planet PHP

One feature telnet has and I always missed from ssh was the ^] shortcut, giving you a way to terminate the connection.

ssh has a similar feature. If you setup 'escape characters', you can terminate the connection by typing '~.' Just add the following to your .ssh/config:

  1. Host *
  2. EscapeChar ~

You can change the character here too, but ~ is the default and a sensible one.

If you're dealing with crappy ssh connections that often terminate, you can add the following to make the client send a keep-alive package every 60 seconds:

  1. Host *
  2. ServerAliveInterval 60