How to make several ssh keys in Ubuntu for manage different repositories in GitHub

In this tutorial, I will explain how to make a ssh key for different repositories.

Make ssh key in Ubuntu system

bash
cd ~/.ssh/
typescript
ssh-keygen -t rsa -b 4096 -C "you@example.com"ssh-keygenGenerating public/private rsa key pair.Enter
file in which to save the key (/home/name/.ssh/id_rsa): id_rsa_personalEnter passphrase (empty for
no passphrase): Enter same passphrase again: Your identification has been saved in
id_rsa_personalYour public key has been saved in id_rsa_personal.pubThe key fingerprint is:
bash
cat id_rsa_p2.pub

Add to Github account

How to make several ssh keys in Ubuntu for manage different repositories in GitHub

Add account in Config

bash
cat configHost github.com    User user1    Hostname github.com    IdentityFile ~/.
ssh/id_rsa
IdentitiesOnly yes                Host github2    User user2    Hostname github.com    IdentityFile
~/.
ssh/id_rsa_personal    IdentitiesOnly yes

Git clone repository

bash
git clone git@github.com:name/repository.git

Add email and username in folder

bash
git config  user.email "email@gmail.com"
git config  user.name  "Name"

Add Git remote

bash
git remote add selectedName git@github2:name/repository.git
bash
git remote -v

Push on server

git push selectedName main