Generate your first ssh key, for this type the following command line in your terminal:
ssh-keygen -t rsa -b 4096 -C "[email protected]"
Now copy the content of your public key and add it to Github:
cat /home/username/.ssh/id_rsa.pub
Go to the following folder: ~/.ssh
by typing: cd ~/.ssh
. And rename your keys:
mv id_rsa id_repo1_rsa
mv id_rsa.pub id_repo1_rsa.pub
Now we need to configure our keys in the repo and ssh, to do this type the following command line:
nano ~/.ssh/config
And add the following content:
Host repo1
HostName github.com
User git
IdentityFile ~/.ssh/id_repo1_rsa
IdentitiesOnly yes
Now we can clone our repository via ssh with the following command:
git clone git@repo1:YourGitHubName/repo1.git