Score:0

ServerAliveInterval doesn't keep my ssh connection alive

cn flag

I'd like to keep my ssh connection to server alive even when it is idle.

I have below settings in the server side:

$ cat /etc/profile.d/auto-logout.sh
readonly TMOUT=1800
export TMOUT

and there is NO ClientAliveInterval setting in /etc/ssh/sshd_config

The behavior is it get disconnected after 30 minutes, as expected.

So I add below ssh config on client side ~/.ssh/config:

Host *
ServerAliveInterval 120
ServerAliveCountMax 2

But it has no effect (I am pretty sure the ~/.ssh/config is loaded)

What else could I check? are there any settings either on the client side or on the server side that could disable the keep alive feature?

Baiyan Huang avatar
cn flag
Current understanding is: ssh `ClientAliveInterval/ServerAliveInterval` are to stop idle connections from being disconnected (by routers?), it can't stop `TMOUT` set by auto-logout.sh
I sit in a Tesla and translated this thread with Ai:

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.