Question

How to resetup my ssh keys?

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?


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.

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.

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

Can you access it via the DigitalOcean terminal?