Following the instructions in this link I managed to create a repository on my $HOME
on the uni's server. I clone/pull/push to this repository on the server using SSH
.
My question is: Is it possible to grant access to someone else to clone/push/pull
from this repository? Obviously I do not have root privileges on the server side. Furthermore, I don't want to have it as a public repository... I want to know who is cloning and pushing to this one.
Can I do something like that on the web-storage part of my account? Where my wesite is stored, and then use something like htaccess
to manage access?
You could set POSIX ACLs on the repository, to allow more users to access it. But that won't guarantee somebody commits as another user / it's quite cumbersome to configure / ...
Instead, I suggest you to use gitolite: https://github.com/sitaramc/gitolite.
It works in a way very similar to the pull/push mechanism on github: one ssh user, a custom shell that authenticates the user depending on the ssh key that was used to login.
If you want something more complex (github-like, with a web UI providing lots of features), have a look at gitlab (http://gitlabhq.org/) or gitorious (http://getgitorious.com/).
In order to be able to login normally on the server as the user in which you installed gitolite:
~/.ssh/id_rsa-git_admin
on your workstation~/.ssh/authorized_keys
file on the machinegit clone git@yourhost:gitolite-admin
, and make sure it works.ssh -i ~/.ssh/id_rsa-git_admin git@yourhost
If the last two steps are ok, your installation is fine.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With