Unable to SSH via key

February 17, 2019 571 views
Getting Started Ubuntu

I am able to log in via console access, but would prefer to use XShell / Putty, but have not been able to login using a key.

Via console access, I can see that the key in ~/.ssh/authorized_keys is identical to the one on my local box (character for character, plus. I can also see that the fingerprints are identical). Yet, I get this error from XShell:

"The selected user key is not registered in the remote host. Try again."

When I try with Putty (obviously with a correct key), I get this error:

"Disconnected: No supported authentication methods available (server sent: publickey)"

I've lost count of how many official DO tutorials I've gone through. I've also tried speaking with customer support on two separate tickets and it's been an incredibly frustrating experience as each time I reply, I get a reply from a completely different tech, and not one of them has actually read my ticket fully.

Clearly, I have done something wrong, I just don't know how to determine what that is. I would be most grateful for any advice on how I can debug this further please. I am leaning heavily towards moving to DO, but at this point am having to consider Vultr as I've already wasted a week just trying to figure out how to SSH in to my own server. :/

Thank you very much

1 Answer

Hey @appl3s !

Unfortunate to hear you are having trouble with setting up ssh keys. This can sometimes be a pain to setup, but once you got the hang of it .....

This could actually be any kind of problem, it could be:

  • Indeed a wrong key, on either side
  • A wrong permissions set
  • A wrong configuration
  • A problem with the Client you are using

I always try to exclude things by checking logs, and testing out.

"Disconnected: No supported authentication methods available (server sent: publickey)"

This most of the time means that you're not providing an SSH key at all, or a wrong one. Please first of all tell me how you are configuring your client. And also give some logs you can find on your server.

You can also first check out my tutorial about setting up SSH keys on Debian, this should be the same on Ubuntu, except restarting SSHD will probably be like:

service ssh restart

Hope this was hopefull for you.

Have another answer? Share your knowledge.