SSH sessions close after 1 hour

We have 3 AL8/CL8 and 1 AL9/CL9 servers running cPanel.

All 4 servers close SSH sessions after 1 hour, no matter the settings in sshd_config, logind.conf, PuTTY, .bashrc, or .bash_profile. The AL8/CL8 boxes were upgraded from Centos7/CL7 using cPanel elevate process with no issues. Prior to the upgrade, ssh sessions stayed open as long as we need them.

These are not idle sessions; disconnects happen even while actively typing. We suspect this may be related to the lack of output from w or who when logged in via ssh - only console sessions are displayed. However, we’ve found nothing definitive.

We have searched far and wide for an explanation and fix, and all we’ve been able to find are people complaining about the same thing, with no solution. It would be great if somebody had a fix.

After some poking around, it’s clear that lack of ssh sessions listed in the w and who output is not related.

I hate to say it, but the only time I’ve seen this kind of behavior is with a public server that’s been compromised at the root level. I’d recommend checking your servers for rootkits, and taking steps to remedy the situation (likely a fresh OS install and a restoration of the account backups).

Did all that. The AL9/CL9 box is brand new.