Fix: ssh client timeouts in OS X

Posted by Bryan Murphy | Posted in apple, Technology | Posted on 18-06-2006

Using OS X and getting a lot of this?

Read from remote host blah.bligityblah.com: Connection reset by peer
Connection to blah.bligityblah.com closed.

So was I. At first I assumed it had to be Comcast, because Comcast falls into the auto scape goat category the same as Microsoft and the Bush Administration.

Before I became all accusatory and call and complain I did my home work.

The man page for ssh_config has the following to say.

TCPKeepAlive
Specifies whether the system should send TCP keepalive messages
to the other side. If they are sent, death of the connection or
crash of one of the machines will be properly noticed. However,
this means that connections will die if the route is down tempo-
rarily, and some people find it annoying.

The default is “yes” (to send TCP keepalive messages), and the
client will notice if the network goes down or the remote host
dies. This is important in scripts, and many users want it too.

To disable TCP keepalive messages, the value should be set to
“no”.

Sounds like that could be the problem. Issuing the following command as root will add the directive to the bottom of the ssh_config file and you should be good to go.

echo “TCPKeepAlive no” >> /etc/ssh_config

UPDATE: At least I thought you should be good to go. After running like that for a while I still lost my connection. Does anyone else have any insight into why this may be happening? I suspect Comcast, again. :)

Comments: