News for hackers. Stuff that matters.
Re:My ISP Is Killing My Idle SSH Sessions by theamk on Monday January 11, 2021 @06:46PM (#25739917)
Correction: TCP keepalives, ssh server keepalives, and ssh client keepalives are three distinct and independent mechanisms. You only need one.

I usually just do client keepalives as they are easiest to set up. Server keepalives are good if you are worried about “forgotten” clients. TCP keepalives are usually not worth it IMHO.

Re:My ISP Is Killing My Idle SSH Sessions by gregmac on Monday January 11, 2021 @07:50PM (#25740720)
I also changed to using client keepalives after something in our office network changed: they installed new switches and access points and suddenly my ssh sessions wouldn't stay open. After getting nowhere with IT (mainly just a low priority issue to them) it was just less frustrating to enable keepalives and the problem disappeared, so that's my default config everywhere ever since.
Re:My ISP Is Killing My Idle SSH Sessions by GekkePrutser on Monday January 11, 2021 @08:23PM (#25741045)
I think TCP keepalives are conceptually the best though. As your problem occurs at the transport level, not the application layer.

This way you solve it where the issue occurs, and with the added benefit that it works for all TCP connections, not just SSH.

However I haven't had this issue. My isp is pretty ok in this regard and I supply my own router. So I don't know if there's issues with this in real life.

Re:My ISP Is Killing My Idle SSH Sessions by dfox on Monday January 11, 2021 @09:03PM (#25741327)
Some NAT implementations ignore TCP keepalives. Alcatel branded ADSL modem/router I had used in 2005-ish certainly did and IIRC some more recent Zyxel ones do the same.