-1

I'm using a public key on the server and a private key on my local for authentication. Also I access databases on my server through tunneling.

But sadly when I leave that connection alone for about 1 min, that connection will be closed. Why? How can I make it alive forever (until I close it)?

enter image description here

Martin AJ
  • 6,261
  • 8
  • 53
  • 111

1 Answers1

1

In your session properties, go to Connection and under Sending of null packets to keep session active, set Seconds between keepalives (0 to turn off) to e.g. 300 (5 minutes).

Source: https://patrickmn.com/aside/how-to-keep-alive-ssh-sessions/

Chris Snow
  • 23,813
  • 35
  • 144
  • 309
  • Thanks to the link you provided, I cannot connect to my server anymore https://superuser.com/questions/1249225/how-can-i-keep-ssh-connection-alive – Martin AJ Sep 11 '17 at 04:42
  • If you are struggling with the server side config of sshd, you could try an alternative like [autossh](https://linux.die.net/man/1/autossh). Here are some instructions for [windows clients](http://tutorialspots.com/how-to-create-ssh-tunnel-on-windows-by-using-autossh-2984.html) – Chris Snow Sep 11 '17 at 13:20