Question

Another Permission Denied (Public Key) error

I am on the process of cloning the ghost open blog cms, theres an option to run a vps through digital ocean. Choosing this method the droplet is created. Next step is to login as root@XXXXX

While doing so I got the dreaded Permission denied (public key). I re-created the ssh keys and updated in digital ocean but that didn’t solve the issue.

While running ssh -v root@xxxx command the output was as follows:

OpenSSH_8.1p1, LibreSSL 2.7.3 debug1: Reading configuration data /etc/ssh/ssh_config debug1: /etc/ssh/ssh_config line 47: Applying options for * debug1: Connecting to xxx [xxx] port 22. debug1: Connection established. debug1: identity file /Users/dad/.ssh/id_rsa type 0 debug1: identity file /Users/dad/.ssh/id_rsa-cert type -1 debug1: identity file /Users/dad/.ssh/id_dsa type -1 debug1: identity file /Users/dad/.ssh/id_dsa-cert type -1 debug1: identity file /Users/dad/.ssh/id_ecdsa type -1 debug1: identity file /Users/dad/.ssh/id_ecdsa-cert type -1 debug1: identity file /Users/dad/.ssh/id_ed25519 type -1 debug1: identity file /Users/dad/.ssh/id_ed25519-cert type -1 debug1: identity file /Users/dad/.ssh/id_xmss type -1 debug1: identity file /Users/dad/.ssh/id_xmss-cert type -1 debug1: Local version string SSH-2.0-OpenSSH_8.1 debug1: Remote protocol version 2.0, remote software version OpenSSH_8.2p1 Ubuntu-4ubuntu0.2 debug1: match: OpenSSH_8.2p1 Ubuntu-4ubuntu0.2 pat OpenSSH* compat 0x04000000 debug1: Authenticating to xxx as ‘root’ debug1: SSH2_MSG_KEXINIT sent debug1: SSH2_MSG_KEXINIT received debug1: kex: algorithm: curve25519-sha256 debug1: kex: host key algorithm: ecdsa-sha2-nistp256 debug1: kex: server->client cipher: chacha20-poly1305@openssh.com MAC: <implicit> compression: none debug1: kex: client->server cipher: chacha20-poly1305@openssh.com MAC: <implicit> compression: none debug1: expecting SSH2_MSG_KEX_ECDH_REPLY debug1: Server host key: ecdsa-sha2-nistp256 SHA256:ecNEC3rocsntZyTMyGGH7MHfMoMufrPOmG8hPRgkwzs debug1: Host ‘xxx’ is known and matches the ECDSA host key. debug1: Found key in /Users/dad/.ssh/known_hosts:1 debug1: rekey out after 134217728 blocks debug1: SSH2_MSG_NEWKEYS sent debug1: expecting SSH2_MSG_NEWKEYS debug1: SSH2_MSG_NEWKEYS received debug1: rekey in after 134217728 blocks debug1: Will attempt key: /Users/dad/.ssh/id_rsa RSA SHA256:/2EjDyRz3HYYyLqEegdjzEy2PfgIGnMNXvwbPzMgRqg debug1: Will attempt key: /Users/dad/.ssh/id_dsa debug1: Will attempt key: /Users/dad/.ssh/id_ecdsa debug1: Will attempt key: /Users/dad/.ssh/id_ed25519 debug1: Will attempt key: /Users/dad/.ssh/id_xmss debug1: SSH2_MSG_EXT_INFO received debug1: kex_input_ext_info: server-sig-algs=<ssh-ed25519,sk-ssh-ed25519@openssh.com,ssh-rsa,rsa-sha2-256,rsa-sha2-512,ssh-dss,ecdsa-sha2-nistp256,ecdsa-sha2-nistp384,ecdsa-sha2-nistp521,sk-ecdsa-sha2-nistp256@openssh.com> debug1: SSH2_MSG_SERVICE_ACCEPT received debug1: Authentications that can continue: publickey debug1: Next authentication method: publickey debug1: Offering public key: /Users/dad/.ssh/id_rsa RSA SHA256:/2EjDyRz3HYYyLqEegdjzEy2PfgIGnMNXvwbPzMgRqg debug1: Authentications that can continue: publickey debug1: Trying private key: /Users/dad/.ssh/id_dsa debug1: Trying private key: /Users/dad/.ssh/id_ecdsa debug1: Trying private key: /Users/dad/.ssh/id_ed25519 debug1: Trying private key: /Users/dad/.ssh/id_xmss debug1: No more authentication methods to try.


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.

Hi there,

Once you update your SSH key and add it to your DigitalOcean account, for all of your old Droplets you would need to also add the key to the ~/.ssh/authrozied_keys file in order to be able to use it.

You can follow the steps on how to do that here:

https://docs.digitalocean.com/products/droplets/resources/lost-ssh-key

Let me know how it goes! Regards, Bobby