15

The console in the digital ocean like this :

enter image description here

I try to copy and paste my username and password, but it does not work

I try ctrl+v and right click on the mouse. It does not work

How can I do it?

moses toh
  • 12,344
  • 71
  • 243
  • 443
  • DigitalOcean’s Droplet console allows you to paste content since August 14, 2018, as per their official [release notes](https://www.digitalocean.com/docs/release-notes/). – caw Sep 19 '18 at 22:09

3 Answers3

25

I have the same problem. I needed to add ssh key to the existing droplet. So, best solution was to upload file to the droplet from dropbox and copy text.

Solution

On the authorized web console of your droplet or on the connected to your droplet local terminal execute code:

curl https://www.dropbox.com/s/*******/****?dl=1  -o temp -J -L
cat temp >> ~/.ssh/authorized_keys

Links

Use curl to download a Dropbox folder via shared link (not public link)

Vasily Bodnarchuk
  • 24,482
  • 9
  • 132
  • 127
  • Alternatively, you can use Visual Studio Code. It can create, open, edit, and transfer files on the virtual machine from within the code editor like you would on your regular computer. It also doesn't have limitations like the droplet console. The droplet console can't scroll through its output, its window size is small, and doesn't expand when maximized, and it incorrectly formats pasted text. – david-littlefield Jan 29 '22 at 00:02
  • Link to tutorial: https://medium.com/p/44afcc954d38 – david-littlefield Jan 29 '22 at 00:27
7

Alternatively, you can also upload your file to file.io and curl that in a more simple way.

file.io also deletes the file after access.

Step 1: Upload file to file.io
Step 2: Copy the generated link that file.io generates
Step 3: Curl the webpage and save it. (First command)
Step 4: Append it to the "authorized_keys" file in your .ssh folder.(Second command)

Commands to enter:

curl fileIOLink -o fileNameOnServer
cat fileNameOnServer >> authorized_keys

I believe this solution helps as it appears easier to simply upload to file.io since it does not require an account to use.

Mal Ball
  • 71
  • 1
  • 2
3

paste this code in console (left click on empty black screen in digital ocean console, then select Inspect - after that, choose the console tab):

!function(){function t(){function n(t,e){s=s.concat(RFB.messages.keyEvent(t,e))}var o=e.shift(),s=[],i=o.charCodeAt(),c=-1!=='!@#$%^&*()_+{}:"<>?~|'.indexOf(o),r=XK_Shift_L;c&&n(r,1),n(i,1),n(i,0),c&&n(r,0),rfb._sock.send(s),e.length>0&&setTimeout(t,10)}var e=prompt("Enter text to be sent to console").split("");t()}();

it will open a prompt box, just paste the text you want to paste - and it will paste it on console.

  • 1
    Answers like this that contain some "magic" text to be pasted into a console should be heavily annotated or explained. What is all of this stuff? Is it a fork bomb? Is it malicious? This answer is especially confusing because it uses the term "console" to mean two different things: (1) droplet console (2) browser javascript console. – Alan Porter Oct 05 '22 at 20:09