Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Save daveworth/4579004 to your computer and use it in GitHub Desktop.
Save daveworth/4579004 to your computer and use it in GitHub Desktop.
If you have two different SSH keys that GitHub knows about make sure you add yours first if you want your commits to have your name associated with commits! In the below situation I have my ssh key that GitHub knows about and another users in `deploy_id_rsa` which is used for deploying code to production servers and allows any changes made to ch…
$ ssh-add -D
All identities removed.
$ ssh-add ~/.ssh/id_rsa
Enter passphrase for /Users/dworth/.ssh/id_rsa:
Identity added: /Users/dworth/.ssh/id_rsa (/Users/dworth/.ssh/id_rsa)
$ ssh -T git@github.com
Hi daveworth! You've successfully authenticated, but GitHub does not provide shell access.
$ ssh-add ~/.ssh/deploy_id_rsa
Identity added: /Users/dworth/.ssh/deploy_id_rsa (/Users/dworth/.ssh/deploy_id_rsa)
$ ssh -T git@github.com
Hi daveworth! You've successfully authenticated, but GitHub does not provide shell access.
$ ssh-add -D
All identities removed.
$ ssh-add ~/.ssh/deploy_id_rsa
Identity added: /Users/dworth/.ssh/deploy_id_rsa (/Users/dworth/.ssh/deploy_id_rsa)
$ ssh-add ~/.ssh/id_rsa
Enter passphrase for /Users/dworth/.ssh/id_rsa:
Identity added: /Users/dworth/.ssh/id_rsa (/Users/dworth/.ssh/id_rsa)
$ ssh -T git@github.com
Hi <other username>! You've successfully authenticated, but GitHub does not provide shell access.
@daveworth
Copy link
Author

Note: This also caused problems checking out repos from other GitHub Organizations since the <other username> key did not have access to them!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment