I’ve followed the instructions in the 2 questions below:
https://www.digitalocean.com/community/questions/ssh-connection-drops-too-frequently https://www.digitalocean.com/community/questions/keep-my-ssh-session-alive
Despite this, my SSH connection drops extremely frequently, often after less than a minute of inactivity. When the connection drops, the terminal window freezes and I have to close it and open a new one. I know that the user session is kept alive for a while by the host.
Any suggestions beyond:
ClientAliveInterval 30 TCPKeepAlive yes ClientAliveCountMax 99999
and restarting the daemon?
Connecting from macOS Big Sur using iterm 2. Connections to other machines (not Digital Ocean) absolutely normal.
This textbox defaults to using Markdown to format your answer.
You can type !ref in this text area to quickly search our full set of tutorials, documentation & marketplace offerings and insert the link!
Hi @atjbramley,
You need to edit your local SSH config as well. You’ve finished the first part with the questions you’ve provided.
What you need to do is add
- ServerAliveInterval 30
locally.
There a couple of ways to do so. You can add it in the /etc/ssh/ssh_config file like so
- ServerAliveInterval 10
or in your .ssh/config file:
- Host *
- ServerAliveInterval 10
Get paid to write technical tutorials and select a tech-focused charity to receive a matching donation.
Full documentation for every DigitalOcean product.
The Wave has everything you need to know about building a business, from raising funding to marketing your product.
Stay up to date by signing up for DigitalOcean’s Infrastructure as a Newsletter.
New accounts only. By submitting your email you agree to our Privacy Policy
Scale up as you grow — whether you're running one virtual machine or ten thousand.
From GPU-powered inference and Kubernetes to managed databases and storage, get everything you need to build, scale, and deploy intelligent applications.