This article was very useful, but to help people coming from Google, this error (Permission denied (publickey)) also happens if your identity is not set correctly.
When you do ssh_keygen it will generate a new SSH key, which the default name is id_rsa. If your computer happens to have another key already, with another name, your identity might be set to that key.
You should edit ~/.ssh/config, and make sure IdentityFile is set to the correct private key
Hello, I'm Lauriano, a sysadmin, i passionate about Linux, Agriculture and I am also an organic farmer. Join me to explore Monitoring, DevOps, and Inovation!
This article was very useful, but to help people coming from Google, this error (Permission denied (publickey)) also happens if your identity is not set correctly.
When you do
ssh_keygenit will generate a new SSH key, which the default name isid_rsa. If your computer happens to have another key already, with another name, your identity might be set to that key.You should edit
~/.ssh/config, and make sureIdentityFileis set to the correct private keyI solved using this solutions
Thanks for the quick solution! If your on a mac you wanna make this edit here /private/etc/ssh/ssh_config
I lost my access to DigitalOcean,
this tip of yours was my salvation, change the file name to id_rsa
Thanks