SSH Key problem Ubuntu 14.04. Password is need although my home machine and droplet are paired!?

July 1, 2015 6.2k views

I'm new to digital ocean and I used the automagical add SSH Key form to share my public key, however when I ssh from my mac I am prompted for a password. I never used a passphrase when generating the keys so why am I prompted for a password when none was applied and how can I fix it?

droplet using Ubuntu 14.04

  • can you sftp into your droplet? if so, you might want to browse to /home/youruser/.ssh/ and look in authorized_keys to see if your pubkey is in there. If not, add it.

    unless you are using root, in which case you would browse to /root/.ssh

  • SFTP won't work since I can't establish a ssh session without the "password". I'll just destroy the current keys and do this all in the terminal. I was hoping the "SSH Key" feature would work, however it seems that other people run into similar problems. Thanks for the input though!

  • Ugh. I'll have to destroy my droplet and try a 4th time. Also when I set up my droplet initially no password was sent to my email address so I've reset it and the new pw does not work. I'd like to use this service but man this is a bit absurd.

    I've followed all of the directions and tutorials and still no dice. I guess I'll just open a ticket. Yay!!

  • There is probably some simple step you are missing. It really works quite well. I create new droplets each month and add my ssh keys with no problem.

    First, you must add your ssh key(s). Then, when you are creating a new droplet, you choose which keys will be added to that have to click on the keys or it wont add them to that droplet.

  • Hmm the Reply link doesn't work. Anyway I've added new keys for every new droplet and made sure the name was highlighted and still nada. I've created a ticket and attached a log for the support team. Essentially once the keys are paired the server prompts me for a password for root or my user.

    Glad to hear that it works for you so hopefully it is some small detail I'm missing however I'm not very confident that is the case. We'll see I suppose.

  • This makes me think that the permissions on your .ssh folder on your home-computer are not working. You might try (on your home computer):

    sudo chmod go-wrx ~
    chmod 700 ~/.ssh
    chmod 600 ~/.ssh/id_dsa  (or whatever your private key is called)
  • Yeah I made sure that my su has read and write access and I still need a password. Although it appears that the ticket I opened is being looked at and likely tested since now I simply am prompted for a pw.

    Just one of those days when the gadgets decide to rebel I suppose.

  • you can also get some extra information if you add -v when trying to ssh in:

    ssh -v root@myserverip
  • Thanks I went crazy a couple of hours ago and used the -vvv option and it looked like something was wrong with the relationship between the private and public key, but I can't think of how that happened. I'll just wait until support takes a closer look.

  • I'm having the same problem... sadness.

2 Answers

Something similar happens to me also. I have created a droplet and I have applied my existing ssh keys during droplet creation. Everything was working on the first attempt. When I come back the other day it prompts for a password. The same happened with another droplet before.

I was having the same problem. It turns out that at some point a line feed was added in the middle of the ssh key on Digital Ocean's side. The fingerprint is still identical but ssh doesn't work. Make sure the key you are pasting into your settings does not have any line breaks in it.

Have another answer? Share your knowledge.