Is there a client side work-around for a too-short auto logout from an SSH connection?
Solution 1
Is it bash's TMOUT, or ssh? If it's TMOUT, there are a couple options listed here.
-Erik
Solution 2
Add this line to $HOME/.ssh/config
on the SSH client side:
ServerAliveInterval 60
Adjust the interval (60) to whatever works for your situation. See the man pages for details.
I hope it helps.
Related videos on Youtube
![Camille Goudeseune](https://i.stack.imgur.com/Md1tZ.jpg?s=256&g=1)
Camille Goudeseune
Programmer, researcher, and church organist.
Updated on September 18, 2022Comments
-
Camille Goudeseune almost 2 years
I SSH from one Linux host to another Linux host that I don't administer. Its
/etc/ssh/sshd_config
is apparently configured to auto-logout after an interval of inactivity that is too brief for my taste (How do I enable auto-logout of Interactive ssh logins after one hour).Is there any way to keep my SSH session alive, perhaps by sending or receiving a newline character every two minutes?
Workarounds like
while true { echo ' '; sleep 120 }
were common in the days of dialup modems).FWIW, Windows' PuTTY isn't involved at all.
-
Erik Bennett about 7 yearsIs it bash's TMOUT, or ssh?
-
Camille Goudeseune about 7 yearsWell, ssh to other hosts doesn't time out. And $TMOUT isn't defined.
-
Camille Goudeseune about 7 yearsHm, that led me to unix.stackexchange.com/questions/222283/… . Post something like that as an answer, and I'll accept it.
-
-
fixer1234 about 7 yearsThanks for closing the loop on your question. Could you add a sentence or two to explain what this does?
-
Camille Goudeseune about 7 yearsIt's ssh, not TMOUT.
-
Camille Goudeseune over 6 yearsThis answers a different question. The original question is about what to do when you can't change the target host's configuration.