Question

How do I login to my digital ocean server using putty?

I have already asked this, I am having technical issue and I am stuck, I have emailed multiple times still waiting for a proepr response from a human.

when i try to login using root password it keeps showing access denied even though I am 100% certain I have the right password, I have it saved on my phone as a camera shot and also i copied and pasted the same password somewhere safe so i know the password is correct, it keeps saying access denied, I then tried to create and add ssh keys, i went through the proccess of adding it onto putty gen and setup everything correctly, that was also not working and came up as “server refused our keys” or soemthing like that, I am totally stuck now. all i wanna do is install some plugins onto my website i deleted


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.

KFSys
Site Moderator
Site Moderator badge
December 18, 2023

Heya @adorableaquamarinelobster,

By default DigitalOcean Droplets have denied access using Passwords. The suggested way is to use SSH keys which you are urged to add on Droplet creation.

Now, if you have added a new SSH key to Putty, you need to add the public key to your Droplet as well. To do that, you first need to enter your Droplet through the Droplet or Recovery Console. You can check this article on how to do that:

https://docs.digitalocean.com/products/droplets/how-to/recovery/recovery-console/

Once inside, you need to add your public ssh key to the following file ~/.ssh/authorized_keys. Once that is done, you should be able to connect using Putty to your Droplet.

Bobby Iliev
Site Moderator
Site Moderator badge
December 17, 2023

Hey there,

I totally understand the frustration you’re facing with the ‘access denied’ error during your SSH attempts. This usually indicates a configuration on your server that restricts access to SSH key authentication only. Given that your SSH key method also resulted in a ‘server refused our keys’ error, we need to take a different approach to regain access to your Droplet. Here’s a step-by-step guide to help you recover access, the bellow is based on this guide here from the docs:

Step 1: Reset the Droplet’s Root Password

First, let’s reset your root password. This can be done via the DigitalOcean control panel. Here’s how:

  • Navigate to your DigitalOcean control panel.
  • Select the Droplet you are having issues with.
  • Click on the “Access” tab.
  • Under “Reset Root Password,” click the “Reset” button.
  • Wait for an email from DigitalOcean with the new root password.

Step 2: Log in Using the Recovery Console

Once you have the new root password, use the DigitalOcean Recovery Console for initial access. This bypasses the SSH issue entirely. Access the Recovery Console from your Droplet’s “Access” tab in the control panel. Use the new root password provided in the email to log in.

Step 3: Enable Password Authentication

After gaining access to your Droplet, you’ll need to modify the SSH configuration to enable password authentication:

  • Open the SSH configuration file using a text editor, for example, nano:
    nano /etc/ssh/sshd_config
    
  • Look for the line that says PasswordAuthentication no and change it to PasswordAuthentication yes.
  • If you don’t find this line, you can add PasswordAuthentication yes to the file.
  • Save and exit the file. In nano, you can do this by pressing CTRL + X, then Y, and Enter.
  • Restart the SSH service to apply these changes:
    systemctl restart sshd
    

Step 4: Log in Using PuTTY

Now that password authentication is enabled, you can try logging in again using PuTTY with your Droplet’s IP address and the new root password. Remember to select SSH as the connection type and use port 22, unless you’ve configured a different port for SSH.

Additional Notes

  • Ensure you’re entering the correct IP address of your Droplet in PuTTY.
  • If you plan to revert to SSH key authentication later, you can add your public key to the ~/.ssh/authorized_keys file on your Droplet.
  • It’s recommended to disable password authentication once you have set up SSH key authentication correctly for enhanced security.

If you encounter further problems or need additional guidance, feel free to ask!

Best,

Bobby

Try DigitalOcean for free

Click below to sign up and get $200 of credit to try our products over 60 days!

Sign up

Featured on Community

Get our biweekly newsletter

Sign up for Infrastructure as a Newsletter.

Hollie's Hub for Good

Working on improving health and education, reducing inequality, and spurring economic growth? We'd like to help.

Become a contributor

Get paid to write technical tutorials and select a tech-focused charity to receive a matching donation.

Welcome to the developer cloud

DigitalOcean makes it simple to launch in the cloud and scale up as you grow — whether you're running one virtual machine or ten thousand.

Learn more