Instantly share code, notes, and snippets.

Embed
What would you like to do?
Set up GitHub push with SSH keys

Create a repo. Make sure there is at least one file in it (even just the README) Generate ssh key:

ssh-keygen -t rsa -C "your_email@example.com"

Copy the contents of the file ~/.ssh/id_rsa.pub to your SSH keys in your GitHub account settings. Test SSH key:

ssh -T git@github.com
clone the repo:
git clone git://github.com/username/your-repository

Now cd to your git clone folder and do:

git remote set-url origin git@github.com:username/your-repository.git

Now try editing a file (try the README) and then do:

git add -A
git commit -am "my update msg"
git push
@OtiZ2

This comment has been minimized.

OtiZ2 commented Sep 27, 2017

Clone can by direct via ssh
git clone git@github.com:username/your-repository.git

@ragerdl

This comment has been minimized.

ragerdl commented Oct 19, 2017

Given the recent factorability of rsa-2048, it's probably wise to change the first step to include -b 4096 as a flag,

@AndrewPlewe

This comment has been minimized.

AndrewPlewe commented Jan 24, 2018

You can test your RSA keys here: https://keychest.net/roca -- I just generated a 2048 bit key using ssh-keygen and it's not vulnerable.

@AndrewPlewe

This comment has been minimized.

AndrewPlewe commented Jan 24, 2018

...Also, from here: https://crocs.fi.muni.cz/public/papers/rsa_ccs17

"Q: Is the RSA algorithm insecure in general after the disclosure of this vulnerability?
A: No. If the RSA primes are generated as a truly random numbers, our method cannot be applied. For example, keys generated by the OpenSSL library are NOT affected."

@MartinX3

This comment has been minimized.

MartinX3 commented Feb 16, 2018

Thank you for this gist!

It is recommend to use the 4096 bit keys.
You don't know, if there will be bugs found, which will weak your key.
You don't know, if there will be a breakthrough in computer performance.

But later, you should switch to elliptic curve keys.
They are smaller, but stronger compared to RSA.

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