I'm following Github's instructions for adding an SSH key. I've generated the id_rsa.pub file from my AWS EC2 instance, but I cannot complete the step that has me copy the contents of the file using xclip because I cannot install xclip onto the EC2 instance.
sudo yum install
xclip
, but that didn't work ("No package xclip available").So, how do I install xclip on 64-bit Amazon Linux AMI 2012.09?
xclip can also print an X selection to standard out, which can then be redirected to a file or another program. Press F7 to copy all current buffer to clipboard, or a selection, or press shift-F7 to paste all clipboard contents.
Before downloading the file from the EC2 instance to the local machine using the FTP server, make sure the file is inside the home directory on the EC2 instance. Go to the desired directory on the remote side, select the file you want to download, and download the file.
I needed this today for a file larger than a ssh-key, and cat was not enough. You need to enable the EPEL repo in EC2 in order to get xclip:
wget https://dl.fedoraproject.org/pub/epel/epel-release-latest-7.noarch.rpm
sudo rpm -ivh epel-release-latest-7.noarch.rpm
sudo yum-config-manager --enable epel
sudo yum install xclip -y
You don't need xclip. Just ssh
into the EC2 instance and cat
the key to your terminal, then copy and paste it from your terminal to wherever you need it.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With