Question

How to paste ssh key into server using DO console

Basically, for some reason the copy paste does not work between my local machine where I created the key pair and pasting into console into the authorized_keys file. It won’t recognize the correct case of the paste. Really odd.

I need to do this because my pass phrase for the existing key does not work. I am 99% sure that its the original , correct passphrase.

I would like to avoid creating a whole new droplet.

Thanks Steve


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, mrdinghy

Keep in mind that you can also put the key in a file hosted on any Dropbox or remote server and then you can just download it via the console using curl or wget

This should do the job for you as well.

The other option is to temporary enable the PasswordAuthentication from no to yes in order to access your droplet using password and then once you’ve entered your key to disable the PasswordAuthentication again. This way is considered more secure than uploading the key to a Dropbox in case you don’t have any other server to us.

  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

It never did go that way. I tried everything from new keyboard. The cntrl-shift-v and mouse right paste never got a clean version on the DO console. I had to ftp a file with the correct key to the server (thank god that worked) and renamed this to authorized_keys. Works for now… thanks

Hi @mrdinghy,

How are you trying to paste the information into your Web Console. Are you using the key combinations CTRL + V or CTRL + SHIFT + V. If you are not, you should use the second option I mentioned - CTRL + SHIFT + V. In terminals, usually the pasting and copying is done with CTRL + SHIFT. This is because the CTRL + C and CTRL + V key combinations are reserved for other stuff.

Please try with the suggestion and let me know how did it go.

Regards, KFSys