Originally posted on 2020-11-10
I use Blink Shell for iOS to connect to systems with mosh and/or ssh. Sometimes I need to move a key from my laptop to my phone and the most reliable way I've found to do it is to take the key, convert it to a QR code, and then display it in iTerm2.
Seriously! It works!
Make sure you have the iTerm2 shell integration installed so you have the imgcat tool. You'll also need the qrencode tool from Homebrew.
Once you have both of those installed you can do this:
cat file_to_copy.txt | qrencode -o - | imgcat
Then you can open the camera on your phone and it should recognize the QR code.
Be careful! The default option in iOS is to search for the text in your clipboard instead of copy it to the clipboard. So if you use this to copy private keys like I do you definitely don't want to Google the contents of your private key. Instead pull down on the notification and you should get the option to copy the key at the bottom of the screen.