I created an SSH key with PuTTY and can use it to successfully login to my droplet.
I tried to change the SSH key passphrase with
ssh-keygen -p Enter file in which the key is (/root/.ssh/id_rsa): /root/.ssh/authorized_keys Failed to load key /root/.ssh/authorized_keys: invalid format
The content of /root/.ssh/authorized_keys file is exactly the same as that generated by PuTTYgen (Public key for pasting into OpenSSH authorized_keys file).
does anyone know why its invalid of am I doing something wrong? or better still can I debug this?
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!
Accepted Answer
ok thanks. Can I just make sure I’ve got this right …
I created an SSH key with PuTTY, added the public key to my droplet and can use it to successfully login to my droplet.
I was told I could update the passphrase of the key with “ssh-keygen -p” and when I run this command it asks “Enter file in which the key is (/root/.ssh/idrsa)”
when I enter “/root/.ssh/authorized_keys” I get “Failed to load key /root/.ssh/authorized_keys: invalid format”
but the content of /root/.ssh/authorized_keys file is exactly the same as that generated by PuTTYgen (Public key for pasting into OpenSSH authorized_keys file).
so maybe I’ve misunderstood what’s happening?
“When you run the command ssh-keygen -p it regenerates the key” I can’t run ssh-keygen -p becuase I get "“Failed to load key /root/.ssh/authorized_keys: invalid format”
“Check your public and private key, they should be different that what they where before.” If I get it to run, where will it place the new public & private keys?
Hi @helloSquid,
When you run the command ssh-keygen-p it regenerates the key. Check your public and private key, they should be different that what they where before.
In that case, to resolve the issue try to re-add the public ssh key to your ~/.ssh/authorized_keys file.
Regards, KDSys
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.