Question

How to resolve Permission denied (publickey) - multiple ssh keys conflict probably.

Posted March 17, 2020 183 views
DigitalOcean

**I am completely new to DigitalOcean. I have a somehow connected droplet at the first time I have created ssh key. I have given the name id_do_rsa and id_do_rsa.pub just because I am having one more set of ssh for bitbucket.

Now after a few days when I am trying to login using ssh root@xxx.xxx.xx.x it is giving me Permission denied (publickey) error.

In the log using ssh -vvv root@xxx.xxx.xx.x I think it is using id_rsa instead of id_do_rsa

...

debug1: Will attempt key: /Users/username/.ssh/id_rsa RSA SHA256:C2lx71R4KU

...

Is there any way to fix it or will I have to create another key?

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.

×
1 answer

Hi there @jartist77,

What you could do is specify the path to the id_do_rsa SSH key with the -i flag. That way you can use your id_do_rsa SSH key rather than the default one.

The command would look something like this:

ssh -i /path/to/id_do_rsa root@xxx.xxx.xx.x 

Let me know how it goes!
Regards,
Bobby

Submit an Answer