In case you need to setup several git account on the same PC, this link is cool !
In brief generate the private ssh rsa key:
ssh-keygen -t rsa -b 4096 -C "[email protected]"
Store the generated key in ~/.ssh/perso_rsa
. Then edit the ~/.ssh/config
file.
Host github.com
HostName github.com
User git
AddKeysToAgent yes
IdentityFile ~/.ssh/id_rsa
# Personal GitHub account
Host github.com-perso
HostName github.com
User git
AddKeysToAgent yes
IdentityFile ~/.ssh/perso_rsa
Now each time you need to clone a personnal repo, you can use the git clone command with github.com-perso domain address.
sudo apt -qq -y install wget && wget -q https://raw.githubusercontent.com/EasyRiderr/basic_env_files/master/install_my_env.sh && chmod a+x install_my_env.sh && sudo ./install_my_env.sh && rm install_my_env.sh