SSH connection keeps dying on me

I have submitted two tickets, one also via email and have not heard anything back yet.

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

I've replied to both of your tickets. Ticket #1 basically says I have no ideas to the problem you've outlined above, and ticket #2 I just had a Linode 96 open up today - so you're next in line for the upgrade, which is now configured.

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?:

http://www.linode.com/forums/viewtopic.php?p=1921#1921

Thanks!

-Chris

I had a similar problem when using PuTTY on Windows to SSH into my Linode. Instead of messing around with my kernel, I just set Putty to send keepalives every 8 seconds.

You can do this in the Connection category.

This used to happen to me as well, and it turned out to be a router setting which needed to be changed (IP Masquerade timer).

Good luck.

I fixed this by going into /etc/ssh/sshd_config and setting:

ClientAliveInterval 120

I have a similar problem with mine, but I've just been living with it for the moment (on Gentoo). I get disconnects when I either paste in about 10-100 lines (it varies) or whilst doing either an "emerge world" or "emerge sync". Normaly the disconnect happens whilst the SSH is "busy" doing something.

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.

I haven't had this issue on my Gentoo Linode during 'emerge sync' or 'emerge world'… I've had problems with PuTTY before on really bad client side wireless connections in general with any server though.

This started to happen to me also, in the last days.

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

Well, it didn't work:

# 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

Reply

Please enter an answer
Tips:

You can mention users to notify them: @username

You can use Markdown to format your question. For more examples see the Markdown Cheatsheet.

> I’m a blockquote.

I’m a blockquote.

[I'm a link] (https://www.google.com)

I'm a link

**I am bold** I am bold

*I am italicized* I am italicized

Community Code of Conduct