Keep Your SSH Connection Open

  • February 19, 2008
  • Avatar for jacob
    Jacob
    Peddicord

Do you get annoyed when you have a SSH session open, visit your browser for a while, and then return only to find you were disconnected? Most home NAT routers are the cause of this. If your router doesn't offer an option to not shut off idle connections, you are probably better off by setting a keep-alive setting.

To do this, just open /etc/ssh/ssh_config on your home (client) computer. Add the following line:

ServerAliveInterval 180

There you have it! Just remember now, if you leave SSH open accidentally, anyone else can get on it. Remember to close your session when finished.

Avatar for jacob Jacob Peddicord

Home » Articles »