Cannot ssh into my droplet with or with out password / with or without ssh pairs

I am revisiting my application on digitalocean but my keys were on a hard drive that just died. I tried using putty to initiate ssh and it asked me for my username, which I did not know so I went about changing the password inside digital ocean. I was able to access the terminal inside digital ocean but it would not let me modify any files. I suppose I need to change permissions but since I lost root access, I am at a loss as to what to do. Every time I try to enter either via git bash or putty, I get an error. In gitbash, Permission denied (publicKey). In Putty, Server refused your key. I followed about 11 tutorials and no luck. I have the private key stored in my .ssh folder as private.ppk as well as my public key. I copied the single line code into the interface provided by digitalocean and gave it a unique name. In putty, I pointed to the private key. If anyone can help me with this I would greatly apprecate it. Thank you in advance.

Submit an answer

This textbox defaults to using Markdown to format your answer.

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

Sign In or Sign Up to Answer

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.

Want to learn more? Join the DigitalOcean Community!

Join our DigitalOcean community of over a million developers for free! Get help and share knowledge in Q&A, subscribe to topics of interest, and get courses and tools that will help you grow as a developer and scale your project or business.

Hello, @kukulcanwar

You can enable PasswordAuthentication for your Droplet by modifying your /etc/ssh/sshd_config file. Once set to Yes restart the SSH service and connect via an SSH client for a more stable connection. You can then modify your ~/.ssh/authorized_keys file to add the appropriate public key.

This change can be made from the DigitalOcean’s console. If you’re having issues to access the console you can than reach to our amazing support team that can help you further with this.

To enable the PasswordAuthentication follow these steps:

  1. Login to the console on DigitalOcean website.
  2. Type sudo nano /etc/ssh/sshd_config
  3. Change PasswordAuthentication from “no” to “yes” and save the file
  4. Open a terminal on your computer and type ssh username@[hostname or IP address] or if on a Windows box use PuTTY for password login making sure authentication parameters aren’t pointing to a private key
  5. Login with password
  6. Type sudo nano ~/.ssh/authorized_keys
  7. Paste public key text here and save the file
  8. Type sudo nano /etc/ssh/sshd_config
  9. Change PasswordAuthentication from “yes” to “no” and save the file
  10. Log out and attempt to log back in (if using PuTTY make sure you set up auth parameters to point to your private key)

Hope that this helps! Regards, Alex

Hi @kukulcanwar,

The eaisiest thing to do is, enter your DigitalOcean Droplet Console and from there add your new SSH KEY to the


file, OR enable PasswordAuthentication from the sshd_config file located in


Once you edit the file don’t forger to restart your sshd service

service sshd restart

Regards, KFSys