Question

Can't login to droplet with SSH and access console is unresponsive

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/

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.

Subscribe
Share

This comment has been deleted


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.

Accepted Answer

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

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