ssh disconnect

rikona rikona at sonic.net
Tue Jun 9 03:49:26 UTC 2020


On Mon, 08 Jun 2020 15:34:18 +1000
Karl Auer <kauer at biplane.com.au> wrote:

> On Mon, 2020-06-08 at 06:11 +0200, Nils Kassube wrote:
> > rikona wrote:  
> > > I've been browsing using an ssh connection to a proxy for quite a
> > > while, but lately it seems to be disconnecting fairly frequently.
> > > I don't have a config file in my .ssh dir, and the
> > > etc/ssh/ssh_config file does not have a serveraliveinterval 60
> > > entry. If I create a config file in .ssh, with that entry, will
> > > that override all the entries in the etc file so that I have to
> > > also place the active etc entries in my local directory? And, if
> > > I do that, should that take care of the disconnect issue?  
> 
> Entries in your ~/.ssh/config will override entries in your global
> /etc/ssh/ssh_config file.
> 
> Entries on your command line will override both.
> 
> Restrictions imposed by the server trump any options you may set at
> your end, but I am unaware of any server-side option that would refuse
> to answer a keepalive query.
> 
> BTW if you control the server, look into setting ClientAliveInterval
> and ClientAliveMax on the server. That turns on keepalives for all the
> server's clients.

I don't control the server and don't know what the settings are.
 
> You could also look into TCPKeepAlive on the server. If enabled, and
> it is enabled by default, this kills the connection if the keepalives
> don't get through. Turn TCPKeepAlive *off* to improve matters if you
> have a slightly dodgy connection, but be aware that you may have to
> manually kill sessions if they are not terminated properly.
> 
> > I'm not sure if the system wide config file would be ignored, but
> > there is another way - from "man ssh":  
> > > -o option  
> 
> There is no difference between specifying it on the command line and
> putting it into your ~/.ssh/config. except that the command line will
> override ~/.ssh/config.
> 
> Nils' idea of doing this:
> 
> > ssh -o ServerAliveInterval=60 user at host ...  
> 
> ... is good. It's an easy way to find out whether the option works for
> you before adding it to ~/.ssh/config or /etc/ssh/ssh_config.

Thanks much to you and Nils!! I should try this first since I don't know
if it will work.

If I do keep it alive for days, is it a security risk? I'm the only
user at this end.

Rik








More information about the ubuntu-users mailing list