Join 1M+ other developers and:
- Get help and share knowledge in Q&A
- Subscribe to topics of interest
- Get courses & tools that help you grow as a developer or small business owner
What Happens to SSH Public and Private Keys When you "Rebuild" a Droplet?
Hey all, I was having some issues with the configuration of my Ubuntu 20 LTS server that I was going to use to host my Django website, so I decided to use the “Rebuild” dashboard command to wipe my droplet. However, there are some SSH concepts that are a bit murky that I need clearing up as I cannot log into my server anymore [Getting Permission denied (publickey)].
It is my understanding that, when you initially create your droplet using Digital Ocean, you can use the dashboard tool (the one in Account – Settings – Security) to go though the process of setting a Putty SSH key or an Open-SSH key. I had no issues with this during my initial setup of my droplet (I chose to use Putty). Now, is this next statement correct as it may point to a gap or lack of understanding in my knowledge of how SSH works.
If you “Rebuild” your droplet. You can never use the dashboard SSH tool as it can only be used during Initial creation of your droplet.
The evidence for this statement is here:
https://www.digitalocean.com/docs/droplets/how-to/add-ssh-keys/to-existing-droplet/ “For security reasons, you can’t add or modify the SSH keys on your Droplet using the control panel after you create it, but you have several options to add and modify them via the command line. ”
Does this statement apply even when you Rebuild your droplet?
I have another question that may be connected to the above section. When I Rebuilt my droplet I would expect all ssh keys etc. to be completely destroyed. However, if I use Git Bash on my local computer and type ssh root@[my servers ip address assigned by digitalocean], I get a warning about the identity of the host not being able to be establishd and am prompted yes or no to continue connecting. When I choose yes, I get
“Permission Denied (publickey).”
That must mean that my previous statement is false. It seems like there is already a ssh public key on my newly Rebuilt Droplet. I would expect, if it were true that all SSH information is deleted upon Rebuild, that It would ask me for a password.
In sum my two questions are:
- What is the connection between the Digital Ocean SSH key dashboard? Once you create your droplet, is the dashboard never applicable again, and any changes to your SSH keys for that droplet must be made via the command line?
- Are SSH keys deleted upon a Rebuild as it seems like I still have some sort of public key private key authentication on my droplet even after the Rebuild.
Thanks in advance everyone, looking forward to this SSH authentication cleared up so I can continue focusing on the deployment of my website.
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.×