Question
permission denied after creating droplet using ssh keys
I created a new droplet using “Ruby on Rails on 14.04” and added SSH keys in stead of using root password. When I tried connecting through ssh I got these results :(
$ ssh xxx.xxx.xx.xxx
pc@xxx.xxx.xx.xxx's password: *************
Permission denied, please try again.
pc@xxx.xxx.xx.xxx's password:
Then I tried:
$ ssh root@xxx.xxx.xx.xxx
root@xxx.xxx.xx.xxx's password:
Permission denied, please try again.
root@xxx.xxx.xx.xxx's password:
Then I tried:
$ ssh -i /path/to/.ssh/id_rsa_private_key root@xxx.xxx.xx.xxx
root@xxx.xxx.xx.xxx's password:
Permission denied, please try again.
root@xxx.xxx.xx.xxx's password:
I’m not sure what to do at this point … can you help me?
These answers are provided by our Community. If you find them useful, show some love by clicking the heart. If you run into issues leave a comment, or add your own answer to help others.
×
Hmm, I feel like this happened to me a while back too. If your client machine is running Linux you may want to double check the permission settings for the key. You may want to check out this tutorial if you are having key permission problems, but it doesn’t look like you are having those issues.
[http://www.howtogeek.com/168119/fixing-warning-unprotected-private-key-file-on-linux/](http://)
I made the silly mistake once of not using the right key, and that obviously didn’t work. You may want to double check it. Finally, as a worst case scenario I believe that you can go to the Digital Ocean Control Panel for your Droplet and under “Access” I believe that you can click reset root password and it should restore it.
Hope This Helps!
Have a Great Day!
Hi, again…
Just started all over with a new droplet and new ssh key making sure I had the permissions correct like stated in http://www.howtogeek.com/168119/fixing-warning-unprotected-private-key-file-on-linux/
I still have the same problem; what user should I be connecting as when doing ssh? should I be doing
or just
And since I have password protected my private key I guess that is the password being asked for, right? In my public key file id_rsa.pub I have my public key and all the way in the end there is a, mmmmm user?, something like mypc@mypc .. what role does that play in all of this?
thank you for all the help.
This was driving me nuts! NUTS! But this should help you…
BEFORE you try to SSH into server type:
eval `ssh-agent -s
`ssh-add ~/.ssh/id_rsa
whereid_rsa
is the file with your ssh key (this is the default version so chances are yours is the same. If not, change it.ssh root@xxx.xxx.xxx
and hopefully no password required Needed them to log on. (From Tutorial https://www.digitalocean.com/community/tutorials/how-to-connect-to-your-droplet-with-ssh)I am having a similar problem I tried following the instructions above with no luck. I killed the first droplet and started everything from scratch, followed all the instructions in the Tutorial and still no luck. ssh is just not working. Any suggestions?
Thank you @clivestrydom - This did the trick for me.
thank you clive :)
thank you @clivestrydom
I tried all of what was written in here to connect to my server through SSH keys. And nothing worked. Found this tutorial and it worked great which essentially boils down to:
Note: Not sure if this matters, but I generated a
id_ecdsa
key, mostly cause when I trouble shooted the SSH it was trying to hit that unsuccessfully. You may be fine with just usingrd_rsa or id_dsa
.sudo service ssh restart
)And then you should be in like Flynn.
Steps on how to configure your SSH to accept password.
http://webdesignforidiots.net/2016/02/digital-ocean-public-key-access-denied-on-existing-droplet/
thank you clivestrydom
Thank you @clivestrydom
Worked like a charm.