0

When I open an SSH connection to our database server and leave it open for a longer time, the connection gets lost at some point. I don't know why or how, but this happens a lot. I still see the prompt, but can't enter anything. I usually kill the terminal and open a new one. If I wait much longer, I get an error message.

However, when I login to MySQL after logging in with SSH, this doesn't happen. The connection stays open. If this is possible, I guess it's a matter of keeping the connection alive.

How does this work and can I set SSH to do better?

  • Have you tried setting the ServerAliveInterval client-side ssh option? – Patrick Dec 2 '14 at 13:39
1

You can implement ServerAliveInterval, ClientAliveInterval, and ClientAliveCountMax to solve your timeout issue.

Please see this post

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.