Keep SSH Connections Open in Linux

If you like to have ready-to-go access to remote machines (or a home server, perhaps) from your Linux desktop, you might have noticed that you can’t always get what you want. Many home and office routers kill “idle” connections after a certain length of time, forcing you to log in again. The FOSSwire blog points out a one-line addition to the end of the client’s SSH configuration file (found at /etc/ssh/sshd_config in many systems) to fix this:

ServerAliveInterval 180

That should send a little ping out every three minutes to ensure the connection is kept alive. This tip should work on most any OpenSSH server that allows access to its sshd_config file, but, as FOSSwire points out, it means any connections you leave open are just that—open to any nefarious passer-by, so use session-closing caution when needed.


Comments (AU Comments | US Comments)

    There are currently no AU comments for this post.

Post Your Comments

Got something to say? There are two ways to comment:

1. Guests

Click here to comment instantly.

2. Facebook Users

Click below to comment using your Facebook account.

We're looking for comments that are interesting, substantial or highly amusing. If your comments are excessively self-promotional, obnoxious, or even worse, boring, you will be banned from commenting. All comments are moderated.