Report this

What is the reason for this report?

timeout in a ssh connection

Posted on June 21, 2022

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?



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!

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.

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

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

Shouldn’t it be ssh_config instead of sshd_config file to implement changes? Using sshd_config causes errors like e.g: /etc/ssh/sshd_config: line 125: Bad configuration option: Host /etc/ssh/sshd_config: line 126: Bad configuration option: ServerAliveInterval /etc/ssh/sshd_config: line 127: Bad configuration option: ServerAliveCountMax

The developer cloud

Scale up as you grow — whether you're running one virtual machine or ten thousand.

Get started for free

Sign up and get $200 in credit for your first 60 days with DigitalOcean.*

*This promotional offer applies to new accounts only.