Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

SSH Permission denied (publickey) DigitalOcean Ubuntu [closed]

I can't seem to log in to my droplet on digitalocean.

When I try ssh root@162.243.123.123 I get a Permission denied (publickey). I tried resetting the root password and logging in via the digitalocean droplet console, but it won't take the root login or password that was reset. Nor will it take the other username and password that I set up.

Everything was working fine yesterday, but when I started work today I ran into the Permission denied issue. So I'm not sure what changed to make this no longer work. I also checked my github keys to see if it hadn't been added, but my local machines key is there and correct. I've also tried adding the key to the droplet with ssh-copy-id admin@162.243.123.123, but got the same error.

Looking at the keys found when logging into the digitalocean website shows the correct key.

like image 787
Corey Avatar asked Feb 09 '18 19:02

Corey


1 Answers

The issue was on the server-side authorized_keys, but not the ~/.ssh/authorized_keys. It was in a separate /home/user/.ssh/authorized_keys file, where I had to add the ssh-keys. Once I did this the issue went away. Not sure how it got removed from that file since I hadn't modified it. This video helped.

like image 189
Corey Avatar answered Oct 12 '22 12:10

Corey