1

I connect to my device through ssh from my machine. If I am not active for some relatively short time, it closes the session after sometime.

Connection to 10.X.Y.Z closed by remote host.
Connection to 10.X.Y.Z closed.

Is there a way to increase that session hold on timer?

At the moment, I have put the below settings in my ssh config -

ServerAliveInterval 120
ServerAliveCountMax 720

But it is not helping me.

Darshan L
  • 279
  • What is the "relatively short amount of time" before the connection is closed? Is it more or less than the 120 seconds you configured as ServerAliveInterval. Are the client and server on the same LAN or is there a firewall in between that might close the connection? – Bram Nov 04 '20 at 11:50
  • Those *AliveInterval ssh settings have nothing to do with kicking inactive users out. They're supposed to terminate connections where the other end is no longer reachable because of network problems, client/server crashed/freezed, etc. It's probably some shell setting (bash's $TMOUT ?) or some other contrivance which is causing you to be kicked out after some period of inactivity. –  Nov 06 '20 at 07:39
  • See the full explanation for alive options. What is echo $TMOUT on the target side telling (see @user414777) , and what time iterval are we talking about here? – Nils Nov 07 '20 at 21:56

1 Answers1

1

What ssh client are you using? I for example most oftern use PuTTY for my ssh connections. In PuTTY's preferences, there's the option for "Sending of null packets to keep session active". I've set that to 10, and forgot about it. My sessions never disconnect, even if I leave them unattended for days. Hope this helps.

Pourko
  • 1,844