Header Ads

Multiple SSH Keys settings for different github account

Multiple SSH Keys settings for a different Github account

Multiple SSH Keys settings for different github account


1, create ssh in github

ssh-keygen -t ed25519 -C "[email protected]"
~/.ssh/id_rsa
~/.ssh/vs-team


2, add ssh key


$ ssh-add ~/.ssh/id_rsa
$ ssh-add ~/.ssh/vs-team


3, you can delete all cached keys before


$ ssh-add -D

4, finally, you can check your saved keys


$ ssh-add -l

Modify the ssh config


$ cd ~/.ssh/
$ touch config 
$ nano config

Then Add 


#Github account
 Host github.com-tinhngo
HostName github.com
User git
IdentityFile ~/.ssh/id_rsa

#VSCode account
Host vs-ssh.visualstudio.com
HostName vs-ssh.visualstudio.com
User git
IdentityFile ~/.ssh/vs-team


Done, Like and share fanpage !!




No comments