I can't add ssh key, I used ssh-keygen, but digitalocean says key invalid type

I can’t add ssh key, I used ssh-keygen, but digitalocean says key invalid type

I ran ssh-keygen on my local machine from windows 10.

C:\Users\Dell>ssh-keygen Generating public/private rsa key pair. Enter file in which to save the key (C:\Users\Dell/.ssh/id_rsa): id_rsa_abc Enter passphrase (empty for no passphrase): Enter same passphrase again: Your identification has been saved in id_rsa_abc. Your public key has been saved in The key fingerprint is: SHA256:iI0B…2ga0 dell@DESKTOP-4VC… The key’s randomart image is: ±–[RSA 2048]----+ … |OOB*o… | ±—[SHA256]-----+


C:\Users\Dell.ssh>type id_rsa_abc -----BEGIN RSA PRIVATE KEY----- MIIEo…G3rPto0 … 5ItfAoGBAJMSZ0A5tva9ptA8jZKLMQ2sSpYF3szZ7Yag/VHnVHi3muNxtec6e/my bkZvjbWMFsMV/O9lP…eddn0j -----END RSA PRIVATE KEY-----

I tried copy/pasting it, with and without those ----BEGIN/END lines.

And it doesn’t work

It says “Key invalid type, we support ‘ssh-rsa’, ‘ssh-dss’, ‘ecdsa-sha2-nistp256’, ‘ecdsa-sha2-nistp384’, ‘ecdsa-sha2-nistp521’, or ‘ssh-ed25519’.”

I suppose in theory I could create a good password and set up a key myself more manually, but what’s going wrong?

I wonder if maybe i’m doing things a wrong way around e.g. maybe you’re meant to create the key on the remote machine… But I think i’m doing it the right way around… using keys created on the local machine and trying to add them to the remote machine… I think I have that right. But the digitalocean interface isn’t letting me add them.

(not sure what tag to use as I couldn’t see one for ssh)

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.

Hello @userdo

You need to copy the content of the public key -

You can open the file locally on your PC and copy the content of the file and after that connect to your droplet via ssh and add the file to your droplet’s ~/.ssh/authorized_keys file.

You can also check the following tutorial on how to add your ssh-key to an existing droplet:

Regards, Alex