What I want to accomplish is to simply terminate inactive SSH sessions. Just because the user is logged in does not mean that the user is doing something. I need the SSH daemon to logout users after X seconds of inactivity.
Debian Bullseye as well as CentOS does not auto logout inactive SSH sessions. At least not within a reasonable time period. By reasonable, I mean less than 10 minutes.
Before posting this question, I’ve searched and read through serverfault.com similar issues but I could not find any post with the right answers.
After reading a bunch of articles, including Debian's man pages https://manpages.debian.org/stretch/openssh-server/sshd_config.5.en.html I implemented the two options related to ssh inactivity in /etc/ssh/sshd_config file as follows:
ClientAliveInterval 300
ClientAliveCountMax 1
The timeout value is calculated by multiplying ClientAliveInterval with ClientAliveCountMax.
timeout interval = ClientAliveInterval * ClientAliveCountMax
This setup works great on CentOS as i get the "Connection to x.x.x.x closed by remote host." but it does not work on Debian.
Am i misinterpreting the documentation? Could someone explain what I am doing wrong?
Thank you.