I have multiple PCs at home used by 3 users. Is it possible to access different user github accounts via ssh without creating individual user accounts in each PC ?
1 Answers
Yes, it is possible to configure multiple different GitHub user accounts with SSH. The Git FAQ has an entry on this.
Do note, however, that doing this exposes you to the risk that someone accidentally or intentionally pushes data with the wrong account or accesses data that they should not, since SSH keys are secrets. For security reasons, each user should have their own account.
Also note that users sharing the same system account will also need to take special care to store their repositories in different directories and configure user.name
and user.email
appropriately for those directories using Git's includeIf
configuration syntax, which you can read about with git config --help
. GitHub uses the email in the commits, which usually comes from user.email
, to attribute commits to accounts. If you're not sure how to do this, then it's better to create separate users.

- 64,793
- 6
- 84
- 100