13

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.

Corey
  • 835
  • 1
  • 9
  • 32
  • Do you have access to the DigitalOcean dashboard? – Tobias Feb 09 '18 at 19:59
  • Yes, that's how I reset the password and accessed the droplets console. @Tobias – Corey Feb 09 '18 at 20:03
  • 1
    Ok. Check from the droplet console the authorized ssh keys. `cat ~/.ssh/authorized_keys`. If yours isn't in it, add it there. – Tobias Feb 09 '18 at 21:08
  • 1
    How am I supposed to `cat` into the `authorized_keys`? The console won't let me login with the root username and reset password. Or are you talking about the authorized_keys located on my local machine? @Tobias – Corey Feb 09 '18 at 22:13
  • I was finally able to login to the console, realized it doesn't take copied text, so I had to type in the 100 random characters for the password. My authorized key wasn't there. So I added it, and I'm still unable to ssh into the server. Any suggestions? @Tobias – Corey Feb 09 '18 at 23:46
  • 3
    @JamesKPolk actually you should move the question there instead of downvoting it. The question and the answer helped me with a issue. This is the kind of comment that make people run away from SO. – JwJosefy May 02 '18 at 01:22
  • @JwJosefy: 1) I can't move questions; 2) It's off topic; 3) I didn't downvote it and don't pretend you can read minds; 4) you don't know if people "run away" from SO or, if they do, why. – President James K. Polk May 02 '18 at 01:51

1 Answers1

18

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.

Corey
  • 835
  • 1
  • 9
  • 32