booruguru
By:
booruguru

I am unable to use SSH keys

August 29, 2014 3.5k views

I followed the instructed provided by...
https://www.digitalocean.com/community/articles/how-to-use-ssh-keys-with-digitalocean-droplets

...but I am still promoted for my password when I try to login.

2 comments
  • if you can sftp into your server, you could check the folder ~/.ssh/ and see if there is a file named authorized_keys

    that file should have your pub key(s) you created on your home computer.

    If they are all there, then you might want to check permissions on the ~./ssh folder on both your server and your home computer. Sometimes ssh wants the .ssh files locked down on your home computer..at least to 660 if not 600

  • And what if they're not all there?

    In my server's authorized_keys file I see a line that says "ssh-rsa" followed by a string of code. That's it.

2 Answers

And what is they're not all there?

In my server's authorized_keys file I see a line that says "ssh-rsa" followed by a string of code. That's it.

  • That string is your pubkey. It should match the idrsa.pub key that is on your home computer.

    When those two keys match, ssh lets you in without a password.

    So, do those two keys match?

  • Thanks. The keys did not match, so I copied the key on my computer to the authorized_keys file on my server.

  • did that do the trick?

  • Yes it did. Thank you. although, I'm curious what went wrong.

  • There is so many tiny things that it could have been. Who knows!? The important thing is you are learning the basics of how it works.
    Basically:
    Create the keys on your home computer
    Copy those keys to the authorized_keys file

    Once you do that manually and see how easy it is, next time you can trouble-shoot the problem in a few minutes time!

Have another answer? Share your knowledge.