ssh disconnect
Karl Auer
kauer at biplane.com.au
Mon Jun 8 05:34:18 UTC 2020
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.
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.
Regards, K.
--
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Karl Auer (kauer at biplane.com.au)
http://www.biplane.com.au/kauer
http://twitter.com/kauer389
GPG fingerprint: 2561 E9EC D868 E73C 8AF1 49CF EE50 4B1D CCA1 5170
Old fingerprint: 8D08 9CAA 649A AFEF E862 062A 2E97 42D4 A2A0 616D
More information about the ubuntu-users
mailing list