2

I have a git repo, i connect via root to push and pull. I have another user i'd like to have access to my repo.

I have got him to create me a public key file for me to add to my servers ~/.ssh/authorized_keys

How do i then restrict him from having access to my entire server?

4

1 回答 1

3

Set git-shell as their login shell in /etc/passwd, as documented here. Doing this, you can have a single account dedicated to git access for you both.

The more complicated solution is to use something like gitolite to manage access to a collection of repos. I've used it and it's a bit of a pain to set up at first, but it works well and is currently maintained.

Alternatively, Bitbucket hosts unlimited private Git repos for free. You can both point your repos to Bitbucket as origin/master and collaborate there instead. This is what I do now.

于 2012-11-14T15:53:16.977 回答