Problem: ssh session is getting disconnected after idle out time.
Cause: Most firewalls will drop idle connections after a period of time which can interfere with ssh daemon default TCPKeepAlive mechanism.
Solution: Replace the TCPKeepAlive with ClientAliveInterval (in seconds) in /etc/ssh/sshd_config
# turn TCPKeepAlive off and check the client every 5 minutes
# TCPKeepAlive no
# fail after 6 tries (30 minutes)
Then restart sshd or reboot.
How did you like this article?