PDA

View Full Version : Connection reset by peer



philg
02-12-2008, 01:18 PM
Does anyone know if there's a way we can increase the connection timeouts for SSHD and MySQL server?

It's annoying to get "Connection reset by peer" and have to log in again when I've not been using the connection for a few minutes.

Thanks!
Phil

allyn
02-13-2008, 12:24 AM
that's probably your router doing that. i keep ssh connections open for weeks. i had to turn on keepalives in ssh (on linux) to do that, otherwise the router (dlink di-604) would time out the connection.

philg
02-13-2008, 08:44 AM
allyn,
thanks for the reply.

Issue resolved... I added the following to my ~/.ssh/config file:
#TCPKeepAlive yes
ServerAliveCountMax 10
ServerAliveInterval 15

The TCPKeepAlive did not work, so it appears the two ServerAlive options are needed. BTW, I'm on an OS X (10.4) client.

Phil

allyn
02-14-2008, 01:32 AM
i use "KeepAlive yes" and "ServerAliveInterval 500" and that does the trick. i would have posted that the first time but i wasn't home when i responded.

philg
02-14-2008, 10:08 AM
Thanks again!

I've settled on these settings (pings every 5 minutes, gives up after 3 tries):
TCPKeepAlive yes
ServerAliveCountMax 3
ServerAliveInterval 300

Phil