setup private git repository with restricted rights on server without root access


a friend of mine is doing a small website-project in school (group of ~6 people). They want to use git as VCS and need acces to a server.

I have an account on the server from university, but - of course - no root access.

I could create private/public keys for them, to SSH into my account, but I don’t want them to have this power :wink:

I found ‘git-shell’, which seems to be used for restricted access with git (although I’m not sure whether I understood the functionality).

My question is:
Is it possible to configure SSH keys in that way, that the server runs them (and only them) in git-shell in a specified directory (using ~/.ssh/{config,authorized_keys})?
So that they can

  • log in with their SSH key
  • use git, execute scripts etc.
  • use git push/pull from their private+school PC
  • work only in a specific directory (like chroot) eg. ~/web-project/

OR an other idea:

  • Setup the git repository in the apache directory (eg ~/home-page/html-data/web-project).
  • create CGI scripts that build the test page and makes it accessible via http
  • use .htaccess to ensure that only persons with the username/pw can access the repository/directory

Which option could be successful? Other ideas?

Thanks in advance.

If their stuff is not private, they could host it on github for free. There are also other freebie GIT sites.

I know github and already talked to the friend about that, but he doesn’t want the project to be visible/accessible in public. Probably they could invest the $7 per month, but I’m not sure.