SSH connection freezes

Posted September 22, 2021 598 views
Ubuntu 20.04DigitalOcean Droplets


My ssh connected terminal freezes after sometime (after being inactive for few minutes), I’ve changed the /etc/ssh/sshd_config to

TCPKeepAlive yes
ClientAliveInterval 30
ClientAliveCountMax 99999

and restarted the ssh daemon service,

still it’s not working.

(I’m using Ubuntu 20.04 (LTS) x64)

These answers are provided by our Community. If you find them useful, show some love by clicking the heart. If you run into issues leave a comment, or add your own answer to help others.

Submit an Answer
1 answer

Hi @thenishantgiri,

You’ll need to change the SSH settings on your local machine as well. To get your configuration working, make these configuration changes on the client:

Host *
ServerAliveInterval 100

*ServerAliveInterval *The client will send a null packet to the server every 100 seconds to keep the connection alive