Question

I restored from a snapshot and now my ssh is prompting for a password?

SSH config has password authentication as no, and it was ok until i restored a previous snapshot, i deleted the known host record also.


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.

I had (have) the same issue. When restoring an image that already had ssh keys configured, if I ask for an SSH key to be included (the same one already there), it’s no longer possible to use the SSH key to log in. If I don’t include it, then I get an email with a new root password, which defeats the purpose of using password-less SSH, and in fact in my scenario is not usable, since I have disabled root logins and password.

I’d like to know how to do this properly without having a new password set.

In most cases, selecting the correct key on the droplet creation page will insert it into the new droplet on creation. This process depends on cloud-init so if any changes affected that it could potentially result in what you’re seeing. Either way, if you open a ticket with our support team they can boot your droplet to a recovery ISO (Debian based live dvd image) and from there you can manually add your key to /root/.ssh/authorized_keys Once you’ve added your key manually, update your ticket and the support team can remove the recovery image so you can boot back to your disk.