Unix & Linux Stack Exchange is a question and answer site for users of Linux, FreeBSD and other Un*x-like operating systems. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

Im connecting to a server using Putty. I have a connection time-out every 2 minutes if I don't use it. I don't have the same issue while connecting from my office network using the same laptop.

Settings changed:

Seconds between keepalives
share|improve this question
What value have you changed the "Seconds between keepalives" to, in PuTTy? – EightBitTony Apr 28 '14 at 13:00
up vote 0 down vote accepted

Check your SSH servers settings. It sounds like it's disconnecting you if there is inactivity after a set period of time. This are typically the settings you need to play with:

#TCPKeepAlive yes
#ClientAliveInterval 0
#ClientAliveCountMax 3

They're in the file /etc/ssh/sshd_config. These are commented out in my setup, you can check if they're un-commented and try commenting them out or changing their values.

share|improve this answer
Thanks..I dont have the same problem from my office network..Same laptop..same settings – user1050619 Apr 28 '14 at 12:56
@user1050619 - turn up the session logging in PuTTY to see why it's disconnecting you would be the next thing to look into. Also is there a firewall on your home network that you're passing through? – slm Apr 28 '14 at 13:28
After your changes it started working..Thanks.. – user1050619 Apr 28 '14 at 13:35

The server is probably not disconnecting you, it is most likely a router between you and your server, which explains why on different networks (especially the same network as the server) you don't have an issue.

You can fix this on the server side by adding TCPKeepAlive yes to your config (/etc/ssh/sshd_config on debian). Possibly you might need to mess with ClientAliveInterval as well if it's set to too high a value.

On the client side you can check Enable TCP keepalives (SO_KEEPALIVE option) under Connection in PuTTY (it is off by default).

share|improve this answer

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.