Question

timeout in a ssh connection

I have a droplet and i am wanna build a image with docker, but the connection with server expire and lock my terminal before completed the dependencies installation from angular project. What can i do?


Submit an answer


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!

Sign In or Sign Up to Answer

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.

alexdo
Site Moderator
Site Moderator badge
June 23, 2022

Hello there,

In addition to what has already been mentioned, The ClientAliveInterval parameter specifies the time in seconds that the server will wait before sending a null packet to the client system to keep the connection alive.

Once the changes are made, you can reload the ssh daemon and give it another try.

  1. systemctl reload sshd

Regards

Lalitha
DigitalOcean Employee
DigitalOcean Employee badge
June 22, 2022

Hello there,

We understand the SSH Connection times out frequently when working on your application. You can make the following changes in the sshd_config file and try once again.

Host *
    ServerAliveInterval 300
    ServerAliveCountMax 2

KeepAlive yes
ClientAliveInterval 300
ClientAliveCountMax 2

Kindly restart the SSH service after making the changes check if it works. You can also reach out to our Support so that our technical agents can assist you further.

Hope this helps!

Cheers, Lalitha

Try DigitalOcean for free

Click below to sign up and get $200 of credit to try our products over 60 days!

Sign up