Sharing git between different users
I currently have a git setup where git is a user on my linux box. /home/git exists and there are several git repositorie开发者_运维百科s in /home/git. The git user has a shell of /usr/bin/git-shell. If a user needed access to the repository, I'd just grab their SSH DSA public key and embed it into /home/git/.ssh/authorized_keys and they'd be able to work with the repository.
The problem is now that I need a second repository that needs to support a different set of users. I don't want to create a new account for each repository that I create.
What's the best way of keeping this working with SSH? (the easiest way of all the sharing techniques I've seen that git supports)
You might consider using gitosis.
Main advantages are:
- only one ssh user (might be a disadvantage)
- users identified by SSH keys
- users and repos created on the fly by using git itself
Beside Gitosis (mentioned in Marcin Gil answer), , which requires Python and setuptools, best known probably from seminal Hosting Git repositories, The Easy (and Secure) Way blog post, and described in Chapter 4.7 of "Pro Git" book, there is also similar Gitolite tool; it is written in Perl, and is quite new.
精彩评论