I am not able to SSH into my droplets with my private keys. I am not sure what happened. – Server refuses the key.
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!
Hi there,
This usually means the SSH key isn’t being accepted by the Droplet, either because the wrong key is being used or the authorized_keys file on the server is missing or changed.
Double-check that you’re using the correct private key and user. If you recently recreated the Droplet or changed keys in the control panel, the old key won’t work anymore. https://docs.digitalocean.com/products/droplets/how-to/connect-with-ssh/
If the server is refusing the key and you can’t log in at all, the Recovery Console is the fastest way to get back in. From there you can log in as root and check or fix ~/.ssh/authorized_keys, file permissions, or create a new user. https://docs.digitalocean.com/products/droplets/how-to/recovery/recovery-console/
Another thing to check is permissions. If ~/.ssh or authorized_keys has the wrong permissions or ownership, SSH will ignore the file entirely. This happens more often than people expect.
https://docs.digitalocean.com/support/how-to-troubleshoot-ssh-connectivity-issues/
If none of that helps, support can look at the Droplet and confirm what’s going on: https://do.co/support
Heya, @jumezurike
When you see “server refuses the key”, it usually means the droplet is reachable, but the public key being offered is either not present in authorized_keys, has incorrect permissions, or you’re logging in as the wrong user.
If you can’t SSH at all, you can use the Droplet Console from the DigitalOcean control panel. That gives you direct access without using SSH keys. From there you can re-add your public key into:
cat ~/.ssh/authorized_keys
Then, verify SSH settings in /etc/ssh/sshd_config to ensure public key authentication is enabled, and restart the SSH service.
If you’re unsure what’s failing, feel free to share the last part of your ssh -v output (the section where it says “Offering public key”), and we can help interpret it.
Regards
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.