Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How many github ssh keys do I need for a small dev team?

Tags:

git

github

ssh

I'm confused by the concept of SSH keys when it comes to using a remote repository hosted by GitHub. I generated the keys as instructed in http://help.github.com/win-set-up-git/ , but now that I have multiple devs pushing into the repo, I'm not clear if we're all to share one single SSH key or if we all need to generate an individual key per-machine and use that?

Could someone kindly clarify that for me?

like image 500
Alexandr Kurilin Avatar asked Jun 21 '11 03:06

Alexandr Kurilin


2 Answers

An SSH key is used for the user to be authenticated and identified into GitHub.

It is common that, for every different device a user uses to access GitHub, he generates a different ssh-key and register/link it to his GitHub's account.

When you control a project, you control access and permissions based on users, and not SSH keys.

So, when you (as a user) setup your git environment you can create only one ssh-key for each machine you would like to give permission to your GitHub's account.


Update:

Github now recommends using HTTPS instead of SSH keys but everything in this answer remains valid if you replace all SSH key references above by Github's Personal Access Tokens

like image 73
Felipe Sabino Avatar answered Nov 02 '22 13:11

Felipe Sabino


Use a key per developer - each dev should generate their own key. This gives you a better indication of who is committing to the repo, and means that you can revoke a developer's commit rights if/when they leave the company. Otherwise they could just copy the shared key, and you would have to re-issue a new one every time you needed to change access rights.

like image 30
Jamie Penney Avatar answered Nov 02 '22 14:11

Jamie Penney