Any SSH related command ends with "Permission denied (publickey)"

Posted October 3, 2017 1.8k views
Linux BasicsLinux CommandsUbuntu 16.04

I created this Droplet a few months ago. After some time i tried to connect to it again. I got everytime I tried

$ ssh user@server
Permission denied (publickey)

So I just tried to follow the steps again in this tutorial:–2

But anything that connects to the server with SSH (ssh-copy-id) ends abruptly with “Permission denied (publickey)”

The public key I created last was added in Settings > Security > SSH Keys

Any ideas?

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.

Submit an Answer
1 answer


You would need to redeploy the SSH key to your droplet, only adding the SSH key to the Settings > Security > SSH Keys does not actually deploy the key to the existing droplet itself unless you specify so during the droplet creation.

You can follow the steps on how to regain access to your server here:

Hope that this helps!