Here, we’ll use GitHub as an example.
Check for SSH keys on your computer.
cd ~/.ssh
lsCheck for the existence of id_rsa and id_rsa.pub. If they do not exist, create a new SSH key using the following command.
ssh-keygen -t rsa -C “[email protected]”Replace [email protected] with your GitHub username.
Tip
You’ll be prompted three times, so press the Enter key three times.
Retrieve the SSH key.
cat id_rsa.pubCopy the output.
Go to SSH and GPG keys in your GitHub settings, create a new key, and paste the copied text exactly as is.
This completes the Git SSH key setup.