SSH connection keeps dying on me
My SSH connection keeps dying on me and I am trying to get help. It is setup right, but sometimes the connection last for hours, and sometimes it dies after a few minutes leaving open sshd and bash process and it is getting more annoying and worse by the day.
Any ideas?
8 Replies
Regarding the ssh problems, are these with idle ssh connections? Which distro? Have you upgraded sshd? What about keepalive in your sshd config? Have you done traceroutes at the times there are problems?
What about this thread which talks about idle ssh sessions timing out?:
Thanks!
-Chris
You can do this in the Connection category.
Good luck.
ClientAliveInterval 120
It happens to me on other UMLs I have so I dont think my specific problem is Linode related. Doing the same thing on a non-UML machine doesnt have the same problem.. but other than that I havnt been able to find anything more specific as yet.
My Linode runs Debian stable, and I have "KeepAlive yes" in sshd_config.
The box from which I ssh runs Debian unstable.
As mentioned in the thread pointed by caker, I think the problem is this:
# cat /proc/sys/net/ipv4/tcp_keepalive_time
7200
Quite high. I have changed it now, and will see if it fixes the problem.
jp
# cat /proc/sys/net/ipv4/tcp_keepalive_time
1500
# grep keepalive /etc/sysctl.conf
net.ipv4.tcp_keepalive = 1500
# grep live /etc/ssh/sshd_config
KeepAlive yes
ClientAliveInterval 120
I restarted ssh after doing those changes, and sessions still die after some time.
One interesting thing: this only started happening after I switched to a 2.6 kernel (as caker suggested in another thread: http://www.linode.com/forums/viewtopic.php?t=1210
jp