I have a droplet on digital ocean.
As I had to revoke my old SSH keys, I first updated the /root/.ssh/authorized_keys with the new SSH key.
I then deleted the old keys from the file in /root
AND ALSO
(this is the problem creating step, I guess…)
deleted the keys from /etc/ssh in my ubuntu server, thinking they were the SSHs keys I had generated earlier.
ps - I didn’t delete the config files - Ssh_config / ssh_import_id / sshd_config / moduli.
I deleted ssh_host_rsa_key_pub / ssh_host_rsa_key and similar files for dsa / ecdsa / ed25519
Now I’m unable to connect to my server. How do I go about solving this issue?
I do have console access to the droplet and I have backups of the files I deleted from etc/ssh
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!
Hello friend!
Fear not. Use our web console to do this. It’s not as responsive as SSH, you can’t paste into it, but it’s perfect for these emergency situations. What you need to do is generate new host keys. I have a guide for you here:
https://www.cyberciti.biz/faq/howto-regenerate-openssh-host-keys/
Kind Regards, Jarland
Get paid to write technical tutorials and select a tech-focused charity to receive a matching donation.
Full documentation for every DigitalOcean product.
The Wave has everything you need to know about building a business, from raising funding to marketing your product.
Stay up to date by signing up for DigitalOcean’s Infrastructure as a Newsletter.
New accounts only. By submitting your email you agree to our Privacy Policy
Scale up as you grow — whether you're running one virtual machine or ten thousand.
Sign up and get $200 in credit for your first 60 days with DigitalOcean.*
*This promotional offer applies to new accounts only.