How to resetup my ssh keys?

Posted February 23, 2018 3.3k views
SecurityDeploymentUbuntu 16.04

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?

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.

Submit an Answer
2 answers

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/ 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


Can you access it via the DigitalOcean terminal?