DEV Community

Cover image for Generating A New SSH Key and Adding It to Github

Generating A New SSH Key and Adding It to Github

Maedah Batool πŸ‘©β€πŸ’» on April 02, 2019

Sometimes I behave like a crazy weird nerd. The developer instinct has always made me learn new things be it skimming through some random code, a t...
Collapse
 
daanwilmer profile image
Daan Wilmer

If you're on a mac, which seems to be the assumption anyway, you can also use pbcopy < ~/.ssh/id_rsa.pub to get your public key into the clipboard. If you're using linux, you can use use xclip and aliases to get exactly the same result: garywoodfine.com/use-pbcopy-on-ubu...

If you're using windows, well... I guess you could use the WSL to run bash?

Collapse
 
maedahbatool profile image
Maedah Batool πŸ‘©β€πŸ’»

Thanks for sharing it. I had this step in mind probably it got missed. :P

Collapse
 
darkain profile image
Vincent Milum Jr

This is one of those times why I freaggin LOVE using Yubikeys. They generate the SSH key internally, so they are secured. It has a full GUI experience that is quite simple to setup, and one-click copy to clipboard for the public key. Plus it's super convenient to switch between multiple computers, even public terminals, without worry of the private key being compromised, because it can never leave the Yubikey itself.

Collapse
 
tandavala profile image
Jose Tandavala

Thank you, this helped me!

Collapse
 
serranomorante profile image
Patricio

Thanks!

Collapse
 
tandavala profile image
Jose Tandavala

Thank you!

Collapse
 
jonathonllopez profile image
Jonathon Lopez

Thank you for making this post! I just spent 10 minutes following GitHub's documentation on this process, and could not get it to work. This was much simpler!

Collapse
 
jghar profile image
JGHar

If you are on Windows PC use cat ~/.ssh/id_rsa.pub | clip to get your public key into the clipboard.

Collapse
 
stacktracy profile image
πŸ‘©β€πŸ’»Tracy A King

This saved me! Thank you so much!