Question

Yet another "Permission denied (publickey)" issue

Hi all,

I am trying to SSH from OSX to my Ubuntu droplet.I have checked to make sure my public SSH keys match up and I have already gone through the process of a full reinstall. I’ve also applied

chmod -R go= ~/.ssh chown -R $USER:$USER ~/.ssh

logged out and then back in. Nothing works. I’m thankful the browser CLI is available but, I need to use a local terminal. Any advice welcome.

Many thanks. Aaron.

Subscribe
Share

This comment has been deleted

I have the same exact issue!


Submit an answer
You can type!ref in this text area to quickly search our full set of tutorials, documentation & marketplace offerings and insert the link!

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.

@alexdo @baraboom,

Many thanks for that. I’ve done everything you suggest (while getting stuck in the console caps lock loop) and still get stalled at:

Permission denied (publickey, password)

I’ve deleted all the ssh keys from my machine and generated new ones and then followed: Manually from the Droplet without Password-Based Access instructions.

No matter what I do I can’t access the server with the password I supplied or keys. I’ve toggled PasswordAuthentication in sshd_config both ways and still no luck.

Looking online I see many others have a similar issue with remote login to DO droplets. The supplied documentation offers many possibilities but no straightforward path to basic function. Does DO offer paid direct support? I need to get this working soon otherwise I’ll need to try a different supplier (I don’t want to since I’ve already invested a bunch of time getting my Ubuntu server installed with the SW I need via browser CLI)

Kind regards,

Aaron

Hi, @aalborz2020

Do you have multiple SSH keys on your machine? If that is the case have you tried to specify the exact key to connect to your DO droplet.

If you have multiple SSH keys, you may need to specify the path of your private key using the -i flag, as in

ssh -i /path/to/private/key username@203.0.113.0

Make sure to substitute the path to your private key.

As @baraboom already mentioned you can double check our existing tutorial on how to use ssh keys with DO droplets:

https://www.digitalocean.com/docs/droplets/how-to/add-ssh-keys/

and https://www.digitalocean.com/docs/droplets/how-to/connect-with-ssh/openssh/

Hope that this helps! Regards, Alex

Hello, @AaronDay

If you have multiple SSH keys, you may need to specify the path of your private key using the -i flag, as in

ssh -i /path/to/private/key username@203.0.113.0

Make sure to substitute the path to your private key.

As @baraboom already mentioned you can double check our existing tutorial on how to use ssh keys with DO droplets:

https://www.digitalocean.com/docs/droplets/how-to/add-ssh-keys/

and https://www.digitalocean.com/docs/droplets/how-to/connect-with-ssh/openssh/

Hope that this helps! Regards, Alex

So just to recap …

You have your public SSH key on the Ubuntu droplet inside the appropriate ~/.ssh/authorized_keys file You have the private SSH key on your local OSX in the ~/.ssh/ directory with correct permissions

If that’s the case, have you also modified your ~/.ssh/config to use this key when connecting to the host?

If you haven’t done that config step, are you specifying the SSH key to use when connecting, for example:

ssh -i ~/.ssh/your-private-key-file root@IPADDRESS

I hope this helps but more info could be helpful if you’re still having trouble - here’s a tutorial on it as well:

How To Use SSH Keys with DigitalOcean Droplets