Report this

What is the reason for this report?

How to resetup my ssh keys?

Posted on February 23, 2018

My ssh keys were all right till I installed let’s encrypt. since then I had this error

port 22: Connection timed out

I’ve tried to reset my password and tried to install my ssh keys by hand and not from the terminal, nothing works! I can’t access my root user neither my deploy user. How can I fix that, please?



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.

Can you access it via the DigitalOcean terminal?

try creating a new user with sudo privileges - install your key(s) to that user and attempt a login

  • adduser SOMENAME

  • usermod -aG sudo SOMENAME

  • vi /home/SOMENAME/.ssh/id_rsa.pub paste your public key

  • cp -v /home/SOMENAME/.ssh/id_rsa /home/SOMENAME/.ssh/authorized_keys

  • chmod 600 /home/SOMENAME/.ssh/authorized_keys

Replace SOMENAME with a name of your choice.

Ensure your KeyAgent is running on your working computer

  • eval `ssh-agent`

  • ssh-add ~/.ssh/id_rsa

I am assuming your key name is id_rsa and that you are working on a linux of macOS system

then try and ssh to your droplet with the new user using the IP of your droplet

  • ssh SOMENAME@XXX.XXX.XXX.XXX

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.