Score:0

ClientAliveInterval is not closing the idle ssh connection

gg flag

I have the task to close the idle ssh connection if they are idle for more than 5 minutes. I have tried setting these value on sshd_config

TCPKeepAlive no
ClientAliveInterval 300
ClientAliveCountMax 0

But nothing seems to work the idle remains active and does not get lost even after 5 minutes of idle time.

Then I came across this https://bbs.archlinux.org/viewtopic.php?id=254707 they guys says

These are not for user-idle circumstances, they are - as that man page excerpt notes - for unresponsive SSH clients. The client will be unresponsive if the client program has frozen or the connection has been broken. The client should not be unresponsive simply because the human user has stepped away from the keyboard: the ssh client will still receive packets sent from the server.

I can't even use TMOUT because there are ssh client scripts that do not run bash program.

How to achieve this

Openssh version OpenSSH_8.2p1 Ubuntu-4ubuntu0.4, OpenSSL 1.1.1f 31 Mar 2020

cn flag
Did you restart or reload the SSHD service after changing the files? Just checking in case not!
fi flag
@shearn89 Yes ..
cn flag
Sorry, are you OP? How come different account?
mangohost

Post an answer

Most people don’t grasp that asking a lot of questions unlocks learning and improves interpersonal bonding. In Alison’s studies, for example, though people could accurately recall how many questions had been asked in their conversations, they didn’t intuit the link between questions and liking. Across four studies, in which participants were engaged in conversations themselves or read transcripts of others’ conversations, people tended not to realize that question asking would influence—or had influenced—the level of amity between the conversationalists.