How to copy public SSH key

I found myself completely unable to remember this exact command, so let’s save it here forever:

To copy public key from rsa_id.pub to clipboard

pbcopy < ~/.ssh/id_rsa.pub

To show public key from rsa_id.pub in terminal and copy it to clipboard

cat ~/.ssh/id_rsa.pub

There. No more googling this.

Leave a comment

Write something about it