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.
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.
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
Send me any
sshd
messages in the/var/log/system.log
(assuming that you’re running a flavor that uses system.log)cat /var/log/system.log | tail 200