[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Re: ssh session times out annoyingly fast, why?



On Wed, Sep 23, 2020 at 11:49 AM Greg Wooledge <wooledg@eeg.ccf.org> wrote:
>
> On Wed, Sep 23, 2020 at 10:30:15AM +0300, Anssi Saari wrote:
> > Britton Kerin <britton.kerin@gmail.com> writes:
> > > I'm using ssh from a debian box to a rasberry pi (sorta debian also :).
> > >
> > > For some reason ssh sessions seem to time out pretty quickly.
>
> How quickly, exactly?  What is the actual message/behavior you see when
> it happens?  Are they both on the same LAN, or is there some complexity
> in between them (especially a NAT router)?
>
> > Well, the keepalives themselves can cause a disconnect if the keepalive
> > messages are not reaching the other end due to bad connection for
> > example. Looks like by default in Debian client sends keepalives if
> > server is quiet but server doesn't send keepalives to a client.
>
> The normal reason people need to use ServerAlive or ClientAlive is NAT.
> If your connection from ssh client to ssh server goes through a NAT
> router, the router may keep track of activity on that connection, and
> drop the translation when it goes idle for 5 minutes or so.  Forcing the
> *Alive packets to happen every few minutes prevents a NAT timeout.
>
> If there is no NAT involved, then I agree with the previous suggestion
> that this might be a shell's TMOUT variable.  Are you sitting at a shell
> prompt when the "timeout" occurs?  Does the timeout stop occurring when
> you're inside a text editor, for example?

Looks like NAT was the culprit, because top kept it alive.  Internet has bogus
advice on this one because it suggests ServerAliveInterval 1200 or something
which I guess is larger than most firewall timeout.

Thanks for all help good to see debian community still so good.

Britton


Reply to: