Using multiple github accounts with ssh keys
Using multiple github accounts with ssh keys.
Generate ssh key pairs for accounts and add them to GitHub accounts.
Edit/Create ssh config file (~/.ssh/config):
# Default github account: oanhnn Host github.com HostName github.com IdentityFile ~/.ssh/oanhnn_private_key IdentitiesOnly yes # Other github account: superman Host github-superman HostName github.com IdentityFile ~/.ssh/superman_private_key IdentitiesOnly yes NOTE: If you use any account frequently, you should use the default hostname (github.com).
Add ssh private keys to your agent:
[Read More]