Question

Problem with copy-paste into DigitalOcean Droplet´s Console window

I am trying to import the RSA-key of an SSH key-pair by copy-pasting into the Console, the windowed terminal application that opens when you click “console” on the Droplet page.

The prompt only seems to accept normal commands and filters out and really messes up some other characters. (supposedly those who have to be back-slashed ("") normally, while in a normal computer based terminal.)

I´m on MacOS, Yosemite, and using the terminal application. I cannot log in via the terminal and copy-paste from there because the SSH key is not currently in the Droplet list of approved and used SSH-keys. So catch 22 on trying this anywhere except for in the DO Online environmet´s “Console” window. That´s where I am, but I cannot import the text, it just messes up the pasted text.

This is my command that I am trying with:

echo "ssh-rsa AAAAB3... ...79akr/oys9 user@my-computer" \
>> ~/.ssh/authorized_keys

So this command should enter the ssh-rsa text line into the authorized_keys file and then I´ll open it in nano editor to have a look.

Also, the code was copied directly from one of the documentation pages here on DO:

digitalocean.com/docs/droplets/how-to/add-ssh-keys/to-existing-droplet/#manually

Perhaps I´d have an additional issue in the last part of my echo statement, the “user@my-computer”, in the post that is set to “user@00.000.00.000”, so the user and IP of the droplet, instead of my local machine. But still, the copy-paste is the issue here. It does not work.

I know what most would think - “why not just open up the nano editor and paste the code directly into the file?”

Well the nano editor messes up the code pasted into it as well. When I try to import a simple HTML tag into nano editor in the Console app, it fails too. Messes up the initial < of the <html> tags.

Noteworthy:

  • Web browser (while using Console): Firefox.
  • MacOS Yosemite
  • Trying with both English US keyboard layout and my own, Swedish (so European layout), none work.
  • console is laggy during use, but that´s normal, no? A response delay?

Surely I´m missing something?

Possible solutions I see: using terminal on my local computer to upload a txt file via scp (which is based on ssh, no?, so catch 22 again). Using an import command from the Console app online to do the same.

Show comments

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.

Accepted Answer

The issue with the console app doesn´t seem to be improving and there is no solution, but this is another one:

@cjw199 answer to “copy and paste into console” solves the issue for me:

Copied from that issue: To avoid scripts that don’t work or having to use DropBox (for security reasons): 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)

The issue was not solved from the console, but from enabling password access in the sshd_config file and then logging in through the terminal remotely to import the SSH-key.

[SOLUTION] I had the same issue. Everytime I copied and pasted the Key it will only paste about 1/3rd of it. If you really need to paste it via the Web console nano ~/.ssh/authorized_keys and break your pasting up into 4-5 lots. So paste some then paste some more etc. Then save. That did the trick for me. Real pain. Hope that helps.

Hey,

Web consoles in general are not really meant to be used that way. They are only for emergency access.

I would recommend just using SSH to connect, to do that you can check this tutorial here.

If you’ve lost your SSH key you can follow the steps here on how to regain access to your Droplet.

Become a contributor for community

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

DigitalOcean Documentation

Full documentation for every DigitalOcean product.

Resources for startups and SMBs

The Wave has everything you need to know about building a business, from raising funding to marketing your product.

Get our newsletter

Stay up to date by signing up for DigitalOcean’s Infrastructure as a Newsletter.

New accounts only. By submitting your email you agree to our Privacy Policy

The developer cloud

Scale up as you grow — whether you're running one virtual machine or ten thousand.

Get started for free

Sign up and get $200 in credit for your first 60 days with DigitalOcean.*

*This promotional offer applies to new accounts only.