Skip to content

Instantly share code, notes, and snippets.

@vanderb
Last active June 21, 2024 13:41
Show Gist options
  • Save vanderb/e012bc83d4c3ed540f38bef8d049ebd6 to your computer and use it in GitHub Desktop.
Save vanderb/e012bc83d4c3ed540f38bef8d049ebd6 to your computer and use it in GitHub Desktop.
Copy ssh public-key to clipboard on MacOS
alias sshkey="pbcopy < ~/.ssh/id_rsa.pub"

Setup

Add command to your .bash_profile in home-directory. (~/.bash_profile)

Usage

Just use command sshkey in terminal to copy your public-key to clipboard.

@Stavorinus
Copy link

I'ts not really a good practice to post here your public key. It's not a good to share your key at all in the public domain! So you know!

@vanderb
Copy link
Author

vanderb commented Apr 24, 2024

I'ts not really a good practice to post here your public key. It's not a good to share your key at all in the public domain! So you know!

Thanks @Stavorinus.
I deleted the comment from that user!

@jasonekratz
Copy link

I'ts not really a good practice to post here your public key. It's not a good to share your key at all in the public domain! So you know!

Uh...no the whole point of a public key is to share it in the public domain (hence the name public key). Unless of course you meant your private key.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment