How to Keep Your SSH Terminal Connected and from Being Automatically Disconnected by the Remote Computer  
by Anne P. Mitchell, Esq. - Last updated 07/04/2007

Summary: Do you want to stay connected via ssh to a remote computer, even when you're idle? Whether you are on a Windows, Mac, or Linux machine, don't you just hate it when you are connected to a remote system via ssh, and you do something in another window, only to find when you return to your ssh session that you've been automatically disconnected by the remote system, and you have to log in all over again? Here's how make it so that you can stay connected to the remote computer with ssh no matter how long you are idle.
Most Recent Searches that Led to This Page: auto disconnect ssh redhat, stay logged in ssh remote, stay connected ssh, ssh stay logged in on disconnect, ssh remain connected, ssh on putty always disconnects, remote ssh staying loogged in when shutting down computer, putty portable disconnect automatically, putty connects and disconnects, openssh keeps disconnecting worm, mac xterm ssh disconnect, mac terminal disconnects, mac ssh disconnects while idle, mac ssh avoid auto disconnect, internet disconnects ssh connection

Previous Article « Talk About Your Nifty Mobile Cell Phone Games - This One is Motion Detecting 3D Lawn Darts!
Read Next Article » Exploding Cell Phone Kills Man

Don’t you just hate it when you are connected to a remote computer system via ssh, and you do something in another window, only to find when you return to your ssh session that you’ve been automatically disconnected by the remote system, and you have to log in all over again? Here’s how make it so that you can stay connected to the remote computer with ssh no matter how long you are idle.

First, you will need to find your ssh configuration file; if you don’t have one, you will need to create it.

On a Mac, for example, your personal ssh configuration file is at:

~/.ssh/config

If you want to create this change for the entire computer (including other users), you will instead want to use the file found at /etc/ssh/ssh_config

On other types of computers, you can find the ssh configuration file in similar locations (and the individual user file is almost always going to be at ~/.ssh/config).

Now, make a backup copy of the file, just to be safe.

Then edit the actual file to include this simple line:

ServerAliveInterval 300

That’s it!

Now your computer will let the remote server know, every X seconds, that your computer is still there and should not be connected. The number in that line is the number of seconds - in the example above it’s 300 seconds, or five minutes. You may need to adjust the number to suit your own needs, but 300 is usually sufficient.

That’s all there is to it!

Sharing is Caring! Please help us get the word out by sharing this article on Facebook, Twitter, or Google+!

Previous Article « Talk About Your Nifty Mobile Cell Phone Games - This One is Motion Detecting 3D Lawn Darts!
Read Next Article » Exploding Cell Phone Kills Man

You May Also Like:

How to Use and Connect to Your Mifi Wirelessly While it is Connected via USB to Your Computer

How to Change the Quote Attribution Line in the Mac’s Mail.app Mail Program

Get the Best Online Data Backup Solution with this Free Remote Backup Online Site!

The Surprising Portable Computer Backup Appliance - You’re Going to Want One!

How to Create Your Own Free Online Backup Solution and Drop Box System

For additional similar stories check out our archives on Hacking, How To - Tips & Tricks, Internet Providers

 

No Comments »

No comments yet.

Leave a comment

Line and paragraph breaks are automatic, your email address is never displayed.

(required)

(required)


We're sorry, you will only have to do this once:
Enable this image please
I see:
- +
- +
- +
Ironclad CAPTCHA (Security Stronghold)

 

NOTE: We never, ever, ever will recommend any product or service on this site that we have not regularly used ourselves and do not wholeheartedly believe in. In some cases, after being very pleased with a product or service, we may enter into a relationship with the provider of that product or service such that if someone purchases that product or service based on our recommendation, we may get a small payment. Such payments go towards the upkeep of the Internet Patrol. All that said, ads by Google are not our recommendations, and are selected and served by Google, and we do not control what those ads display.