All the commands at one go - (For lazy beings)
ssh-keygen -t rsa -b 4096 -C john@example.com # Generate SSH Key
ls -al ~/.ssh # Verify It
eval "$(ssh-agent -s)" # Max/Linux
ssh-agent -s # Windows
ssh-add ~/ .ssh/id_rsa
pbcopy < ~/ .ssh/id_rsa.pub # Mac/Linux
clip < ~/ .ssh/id_rsa.pub # Windows
cat ~/.ssh/id_rsa.pub # If above don't work
ssh -T git@github.com # VerifyUse Git Bash if using Windows.
ls -al ~/.sshIf you already have an SSH key, please skip step 1.
ssh-keygen -t rsa -b 4096 -C john@example.com - You can use the default directory to store the key pair.
- Optionally use a passphrase for an extra layer of security.
You can now verify this key using -
ls -al ~/.ssh
Mac/Linux:
eval "$(ssh-agent -s)"Windows:
ssh-agent -sssh-add ~/ .ssh/id_rsa Mac/Linux:
pbcopy < ~/ .ssh/id_rsa.pubWindows:
clip < ~/ .ssh/id_rsa.pubGo to settings > SSH keys > Add SSH key
- In Title enter the name of your computer
- In Key paste the key
ssh -T git@github.comEnter Yes.
If you get Hi, then it is done