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.


  • Type: pbcopy < ~/.ssh/

Linux (Ubuntu)

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

Windows (Git Bash)

  • Type: clip < ~/.ssh/

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

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. Required fields are marked *

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