Hello I’m developer and I am trying to buy one more droplet in here, and in the process I have a question.

As I know, public key should be sent to user from server, so in my point of view, it’s normal that first I buy a server and after that I make a ssh key and send public key to my computer.

But when we create new droplet, we add public key that is created in my computer which is not a server. So, I want to know what’s the purpose of add my public key when I buy droplet.

And also, it’s recommended that create new ssh key whenever I buy a new droplet in another purpose? I think the answer is gonna be yes, but I’m not sure.

Thanks.

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
1 answer

Hi @pajaritomoyqi,

The idea behind adding an SSH key when you are creating your droplet is that by default DigitalOcean’s droplets come with Password Authentication turned off regarding SSH access, the only possible way to connect/ssh to your droplet is by using an SSH key. This is done for security reasons

There is no need to create an SSH key every time you create a Droplet, one would be enough.

How SSH keys are being used

Most of what you said about SSH keys is correct but let me give you a little bit more information on the matter.

SSH keys are used to SSH to servers where you have your Key added. By default, SSH keys consist of two files, a private and a public key. You add your public key to the server/droplet you’ll want to have access with SSH key to. Once you try to SSH to the said droplet, you pass your private key to it and if matches the public key it lets you in.

With all that being said, you can have one SSH key and add your public part of that key to a hundred or thousand droplets and use it to SSH to them. As such this is why you need to have an SSH key created prior to creating your Droplet.

Hope this help!