Copy SSH key to Clipboard

Copying my ssh key to my clipboard is always something I have to google. It’s different depending on operating system and depends on what you have installed. This is a short guide on how to copy your ssh key to the clipboard.

Mac

  • Type: pbcopy < ~/.ssh/id_rsa.pub

Linux (Ubuntu)

  • Type and copy output: cat ~/.ssh/id_rsa.pub

Windows (Git Bash)

  • Type: clip < ~/.ssh/id_rsa.pub

Please leave a comment below if you have a better way or would like me to add an additional operating system.


Thanks for reading. Make sure you follow me on Twitter to stay up to date on the progress of my side projects T.LYWeather Extension, and Link Shortener Extension. If you are interested in the tech I use daily, check out my uses page.  

5 thoughts to “Copy SSH key to Clipboard”

  1. And if I want to copy a key from a remote host and to store it in a file in Windows? What file format it should be? I mean code page and other. For example to use in Secure Shell App for Chrome.

      1. I have VPS on CentOS and another one on FreeBSD. Copying from CentOS was with little problems, but OK. But I tried to copy from FreeBSD for 100500 times, with no luck.

Leave a Reply

Your email address will not be published.

This site uses Akismet to reduce spam. Learn how your comment data is processed.