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 id_rsa_abc.pub. 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)
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.