Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Copying a rsa public key to clipboard

Tags:

clipboard

ssh

I am trying to copy a public key to the clipboard on macOS, but I keep getting "no such file or directory." The command I am using is pasted below

pbcopy < ~/.ssh/id_rsa.pub 
like image 978
user1850254 Avatar asked May 19 '13 18:05

user1850254


People also ask

Can I copy public key?

Your public key could be copied manually or using ssh-copy-id tool. There are also some SSH tricks to copy your SSH key to the server.

How do I paste a public key?

Paste the public key into the file by simply right-clicking the SSH client window. Make sure the key goes on a single line for OpenSSH to be able to read it. Note that the key type needs to also be included, ssh-rsa as shown in the example below.


2 Answers

cat ~/.ssh/id_rsa.pub

then you can copy your ssh key

like image 130
Palermo Andre Deschamps Avatar answered Sep 27 '22 17:09

Palermo Andre Deschamps


To copy your public key to the clipboard

cat ~/.ssh/id_rsa.pub | pbcopy 

This pipes the output of the file to pbcopy.

like image 32
iAmWillShepherd Avatar answered Sep 27 '22 15:09

iAmWillShepherd