Home
using multiple github accounts on ya laptop
tags: ##github
- Generate ssh keys
ssh-keygen -t rsa -b 4096 -C "your-email-address" - Enter file in which to save the key (/home/vaati/.ssh/id_rsa):
/home/vaati/.ssh/id_rsa_work| - Open and copy the public key
cat .ssh/id_rsa_work.pub - Paste new
ssh-keyshere: https://github.com/settings/keys; type should beauthentication-key - As the key is saved with unique name, we’ll need to run this command
ssh-add ~/.ssh/id_rsa_work - Create a config file:
nano ~/.ssh/config``` #Default GitHub Host github.com HostName github.com User git IdentityFile ~/.ssh/id_rsa
Host github.com-work HostName github.com User git IdentityFile ~/.ssh/id_rsa_work ```
- When using git command use
git@github.com-workinstead ofgit@github.com