Skip to content

Instantly share code, notes, and snippets.

@alivx
Created October 15, 2020 22:54
Show Gist options
  • Save alivx/76ed15aaf485fbd529cab11585757fe3 to your computer and use it in GitHub Desktop.
Save alivx/76ed15aaf485fbd529cab11585757fe3 to your computer and use it in GitHub Desktop.
Use multiple ssh-keys for different GitHub accounts on the same computer

Create new ssh key

ssh-keygen -t rsa -b 4096 -C "[email protected]"

~/.ssh/config

# Personal GitHub account
Host github.com
 HostName github.com
 User git
 AddKeysToAgent yes
 UseKeychain yes
 IdentityFile ~/.ssh/id_rsa
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment