Question

Connect Droplet via SSH is Unstable. Encounter "timed out" occasionally.

Hi,

I created a docker droplet recently and try to create a generic docker-machine in my windows workspace.

However, I cannot successfully create the docker-machine. After debugging, I found out that I cannot successfully connect to my droplet with SSH every time.

Below is my command to create docker-machine:

 docker-machine -D --native-ssh create --driver generic --generic-ip-address=<IP> --generic-ssh-key <RSA KEY> remote

The command stuck when running SSH command, below is partial log:

About to run SSH command:
sudo hostname docker && echo "docker" | sudo tee /etc/hostname
SSH cmd err, output: <nil>:
(docker) Calling .GetSSHHostname
(docker) Calling .GetSSHPort
(docker) Calling .GetSSHKeyPath
(docker) Calling .GetSSHKeyPath
(docker) Calling .GetSSHUsername
Using SSH client type: native
&{{{<nil> 0 [] [] []} root [0x76ed50] 0x76ed00  [] 0s} 167.71.214.248 22 <nil> <nil>}
About to run SSH command:

                if ! grep -xq '.*\sdocker' /etc/hosts; then
                        if grep -xq '127.0.1.1\s.*' /etc/hosts; then
                                sudo sed -i 's/^127.0.1.1\s.*/127.0.1.1 docker/g' /etc/hosts;
                        else
                                echo '127.0.1.1 docker' | sudo tee -a /etc/hosts;
                        fi
                fi
Error dialing TCP: dial tcp 167.71.214.248:22: connectex: A connection attempt failed because the connected party did not properly respond after a period of time, or established connection failed because connected host has failed to respond.
Error dialing TCP: dial tcp 167.71.214.248:22: connectex: A connection attempt failed because the connected party did not properly respond after a period of time, or established connection failed because connected host has failed to respond.
Error dialing TCP: dial tcp 167.71.214.248:22: connectex: A connection attempt failed because the connected party did not properly respond after a period of time, or established connection failed because connected host has failed to respond.
Error dialing TCP: dial tcp 167.71.214.248:22: connectex: A connection attempt failed because the connected party did not properly respond after a period of time, or established connection failed because connected host has failed to respond.

I try to connect to my droplet with below command:

ssh root@167.71.214.248 echo hi

The command cannot always run successfully. Below is my screenshot:

img

I’m wondering what’s going wrong? Please kindly help me. Thanks a lot.


Reference

  1. Droplet Info info

  2. Docker machine version:

docker-machine.exe version 0.14.0, build 89b8332

I have tried version 0.12 ~ 0.16, but still encounter the same error

  1. My computer
  2. Window 10 Home Edition
  3. Have tried both OpenSSH and SSH in Docker Quick Start terminal
  4. Using DockerTools

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.

Accepted Answer

Hello

This could mean there is a (temporary) problem with the server (or some router along the way). You can try a traceroute to determine whether or not this is true.

You can perform the traceroute on MAC/Linux using:

traceroute 167.71.214.248

On Windows using:

tracert 167.71.214.248

Let me know if you have any questions. Alex

Want to learn more? Join the DigitalOcean Community!

Join our DigitalOcean community of over a million developers for free! Get help and share knowledge in Q&A, subscribe to topics of interest, and get courses and tools that will help you grow as a developer and scale your project or business.

Hi community,

I contact support team for the help.

They reply that it may be due to Window’s OpenSSH.

They said there are some layers which can introduce software firewalls or application blocking.

I tried MinGW’s ssh, it seems that the SSH still get “timed out” sometimes, but much more stable than OpenSSH.

However, since my docker-machine cannot successfully run with external SSH, the problem still not be solved.

I’ll keep updating this thread if there is any update.

Hope this could help others.