[PATCH] Add a Maximum Idle Time (1.2.2)

Jacob Luna Lundberg jacob at velius.chaos2.org
Wed Mar 8 08:12:55 EST 2000


Marc Haber <openssh-unix-dev.mindrot.org at marc-haber.de> wrote:
> >If you can get root on the box that houses the server, try changing
> >_its_ keepalive timeout to 300 seconds.  That might do it for you.
>
> Which config setting is that? sshd_config does only seem to have
> keepalive =3D yes.

/proc/sys/net/ipv4/tcp_keepalive_time
Which defaults to 7200 on recent Linux kernel.  So try:
/bin/echo "300\c" > /proc/sys/net/ipv4/tcp_keepalive_time
Which will give you a 5 min timeout instead of 2 hours...

> And I still don't understand why this problem only shows when the TCP
> connection is NATed.

A good question.  The ssh connection seems to expect the keepalives more
frequently than every two hours.  So without keepalives (or other packets)
happening however frequently it is ssh wants them to, it terminates the
connection (or perhaps linux reclaims the socket, I don't know).

-Jacob

-- 

"Heh.  You mean this is Stef's source code?"
  -User Friendly






More information about the openssh-unix-dev mailing list