Setup ssh key with git/github: Clone private repo using ssh

f you already have a rsa key pair, skip this step and use the same keys. Otherwise, use below command to generate a new public-private key pair. Works on windows, mac and linux.
Replace [email protected] with your github email id.

ssh-keygen -t rsa -b 4096 -C "youremail@something"

Notice it’s capital C .

keygen on windows

When asked for location and file name, hit enter to save to default location.

passphrase prompt

When asked for passphrase, either type a secret passphrase and hit Enter, or to leave empty hit Enter twice.

This generates 2 files:

  1. A public key ending with .pub
  2. A private key without any extension (this is secret and should never be shared)

Click Here

Tags: Clone private