Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to get github-like behaviour for ssh access on my git server

Tags:

git

github

ssh

Suppose we have two separate github users: Foo and Bar. They own Quux and Waldo repositories respectively. So Foo can push to Foo/Quux and cannot push to Bar/Waldo. Opposite is right for Bar. Then Foo cloned his Quux repository:

$ git clone ...
...
$ git remote -v
origin  [email protected]:Foo/Quux.git (fetch)
origin  [email protected]:Foo/Quux.git (push)

Seems while Foo has write access to Foo/Quux repository via git user he has not write access to Bar/Waldo repository via same user. Is there any way I can reach the same behaviour on my git server? Am I supposed to write custom sshd daemon for this purpose?

like image 683
Matvey Aksenov Avatar asked Mar 07 '26 23:03

Matvey Aksenov


1 Answers

You could use Gitolite to get fine-grained access control to your git repositories over SSH where every user is identified by her SSH key.

In contrast to the already mentioned gitosis, Gitolite is still maintained and supports a more fine-grained control over the repository access.

If you want more of GitHub's functionality internally you should take a look at GitLab and of course GitHub Enterprise.

like image 126
joschi Avatar answered Mar 10 '26 15:03

joschi



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!