I had a machine crash, and needed to setup another one with SSH access. I got the console login ok, but no way to paste my public key there. Just spent a whole day trying to find a way to do this.
My solution, finally was to put the public key on a public dropbox folder, then in the console, use:
curl 'https://dl.dropbox.....' > temp1
cat temp1 >> .ssh/authorized_keys
The attached JS snippet never worked for me, and I didn’t have the patience to debug/improve the snippet (maybe that was a mistake since I wasted a whole day). Some versions drop characters, some changed them, some capitalize during the script paste action.
I might understand security issues which caused DO to decide not to allow copy-paste in the console, but they must supply an alternative way to upload an SSH key.
This issue is from 2013. It’s about time DO solved this.