I created a droplet and added my SSH key in the creation process. It worked well, I could easily connect to server from my local machine via SSH.

Later I created a new SSH key in my local machine, I uploaded it to the DO control panel. But as I understand that key is not automatically transferred to droplet if the droplet was already created, right?

So now I can’t login via SSH - Permission denied (publickey).

I opened the tutorial “How to Upload an SSH Public Key to an Existing Droplet” [https://www.digitalocean.com/docs/droplets/how-to/add-ssh-keys/to-existing-droplet/](http://)

So they are saying to use ssh-copy-id. But how can I use this if I can’t login via SSH? I get the same - Permission denied (publickey).

Then I tried to login with “access console” from DO control panel. When it opens I can’t type anything there. I googled it and found out that quite a few people can’t type there. Some fixed it with pressing Ctrl+C, Ctrl+D or some other command. Yet nothing of that sort helped me. I tried it with two Browsers (Chromium and Firefox).

So I don’t know what else to do here. I can’t just create a new droplet, because I have important files in this one.

So what am I missing here about SSH?
Can I login to server from my local machine without SSH, with some password?
Also DO seems good at creating tutorials, so why don’t they create one about this? Because it seems that a quite lot of people are struggling with this.

I can provide more information if needed. Thanks in advance.

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.

×
2 answers

Hello, @mantas393

You’ve mentioned that you’ve created an additional ssh key on your machine, but is the previous still present on your PC? The thing is you can define the exact ssh_key you want to use during the ssh connection using the -i parameter:

ssh -i ~/.ssh/id_rsa root@IPaddress

If this is not solving the issue for you, may I ask what OS you’re using on your local machine? Usually the CTRL + C or CTRL + ] will solve the issue if the console is stuck.

If you’re able to access and type in the console you can then temporary enabled the PasswordAuthentication in order to access the droplet from your local machine and copy your ssh_key

In order to do that, open the sshd config file and make sure the PasswordAuthentication is set to yes:

nano /etc/ssh/sshd_config

PasswordAuthentication yes

Save and close the file and then restart the service:

service ssh restart

You can now access the droplet using a password. If you don;t have the password on file you can quickly reset it from the DigitalOcean control panel.

Hope this helps!

Regards,
Alex

  • Hi, @alexdo

    Thanks for reply.

    I’m sorry, it seeems that I wasn’t clear enough, I reinstalled my OS, that’s why I had to create a new ssh key. There is only one ssh key on my machine.

    I’m using Ubuntu 20.04 with KDE Plasma environment.

    I just tried both of these command ( CTRL + C and CTRL + ] ). It didn’t help.

    As I understand logging into this Control Panel’s console is my only way to retrieve access, right?

    I added screenshot of what I see in the console if this of any help: https://ibb.co/8455CJS And prompt is flickering.

    edited by MattIPv4
    • Hello, @mantas393

      Thanks for providing the screenshot.

      When you initially launch the console you need to enter the root username (type - root) and then enter the root password for the droplet, keep in mind that the characters wont be displayed during the password prompt, this is a security feature, but you still need to enter the root password and then press enter.

      You can try again using the two browsers (you can try also in incognito mode as this should block all the extensions that you’re using, because some of them might be causing the issue for you) and if you’re still unable to type in the console, I will recommend you to reach to our support team and they can check this for you.

      Let me know how it goes.

      Regards,
      Alex

Hello, @sub359

I will recommend you to access your account using alternative browser or with the incognito mode on. If you have any add-blockers running you can temporary disable them.

Also if you’re not sure that the droplet password you enter is correct you can reset it from the control panel. Navigate to the control panel. From the project the Droplet is in, or from the main navigation’s Droplets page, locate the Droplet. Click the Droplet’s name to open its detail page, then select Access in the left navigation.
Click Reset Root Password to reset the Droplet’s password. You will receive an email containing the Droplet’s temporary password.

You can find more information about the password reset from our docs:

https://www.digitalocean.com/docs/droplets/resources/reset-root-password/

Hope this helps!

Regards,
Alex

  • Thank you Alex. I’ve got a new password by email and launched the console. My droplet name is dwa and I get asked for dwa login in the first line. What do I enter here? My email doesn’t work. I get asked for password in the next line.

Submit an Answer