Can't copy/paste into new console!

Posted August 12, 2021 161 views
Ubuntu 18.04

I was forced to update my console on Ubuntu 18.04.3 LTS and now copy/paste is not working.. any idea why?

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.

Submit an Answer
2 answers

Hello, @ndam

The Copy/Paste functionality of our web console is a bit odd; the code backing it is custom due to the way the VNC window is implemented for accessing your Droplet. It isn’t a good idea, in my experience, to rely on the console for long copy/pasting like an SSH key.

My recommended method to get the key on the Droplet is over SSH itself. You can refer to the below articles:

You can enable PasswordAuthentication for your Droplet by modifying your /etc/ssh/sshd_config file. Once set to Yes restart the SSH service and connect via an SSH client for a more stable connection. You can then modify your ~/.ssh/authorized_keys file to add the appropriate public key.

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. Log in to the console on the 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 a 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!

  • I appreciate your detailed and insightful answer! I will definitely try that out

    I do want to mention I actually deleted my question (not sure why it’s still up) because I found a solution an hour after I posted the question:

    Instead of using CTRL+V, I found I can right click on the console and click the “PASTE” option from Chrome’s contextual menu. That actually works, while CTRL+V does not.

Hello there @ndam , and @alexdo , I am running a Digital Ocean Ubuntu 20.04 Server through my terminal on Windows Powershell, and when I try to paste copied text or commands onto the terminal in order to execute a command, it does not materialize. This happens when I copy anything from the terminal itself or even from the web and try to paste it beside a command. How do I solve it? I reckon it is a problem on the server configuration because when I ssh out of the server and back onto my local PC’s terminal, everything works out well when I try to copy and paste commands, i.e using CTRL + C and CTRL + V . I have seen the many links shared but they do not address this issue and seem to rely only on the context of the Digital Ocean web console, which is not in my case. Could you please assist me to figure out what is not happening on my side? Thank you.

  • Hello, @kcelestinomaria127

    • To select text in PowerShell with the mouse, just select it as usual.
    • To copy the selected text to the clipboard you have to either hit Enter or right-click.
    • To paste into the PowerShell window, right-click.

    I will recommend you to use an ssh-client like PuTTY in order to use the copy/paste functionality without experiencing issues.

    1. Highlight the text in Windows.
    2. Press Ctrl+C or right-click the highlighted text and then left-click on Copy in the context menu.
    3. Position the cursor in PuTTY where you want to paste the copied text from Windows, then right-click to paste it or press Shift + Insert.