2

i was searching for a while, but couldn't find a fitting solution: My Case:

I have a server on which i have a git repository. The connection to the server is only possible with fitting ssh key. Is there a possibility to give a user, who hasn't access to the server, permissions to write and read from this specific repository?

Is there only the possibility by creating a user account for the user on the server or can i do it different? OF course i only want him to read/write to the repo, but i dont want him to see what is going on beyond this repository on the server?

Hopefully this is not to much thought outside the box?! Thanks in advance!

NewYearsEve
  • 157
  • 2
  • 11

1 Answers1

2

If you had on the server the authorization layer Gitolite, you will be able to register that external user ssh public key, giving him/her access to one one specific repository (as configure in your gitolite configuration file)

Gitolite

(from the blog post "SSH and the Gitolite Installation – part 2")

VonC
  • 1,262,500
  • 529
  • 4,410
  • 5,250
  • Thanks a lot, that was exactly what i was searching for!!! Though it took me a couple of hours to figure out, i cannot use the same ssh-key for the git user and gitolite :-) and second: the [link](git clone git@server:gitolite-admin) didnt work for me. I dont even know if this is supposed to work, cause tha gitolite-admin folder is in the subfolder repositories, so what worked for me was: [link](git clone git@server:port/home/git/repositories/gitolite-admin) Maybe gitolite wiki is not up to date! – NewYearsEve Mar 24 '12 at 16:02
  • 1
    @NewYearsEve gitolite wiki is very much up-to-date, and `git clone git@server:port/home/git/repositories/gitolite-admin` is very-very-*very* wrong: you just by-passed gitolite entirely, as described in http://sitaramc.github.com/gitolite/sts.html#ssh_troubleshooting_common_ssh_problems_ – VonC Mar 24 '12 at 16:14
  • @NewYearsEve: `git@server:gitolite-admin` is an scp syntax (a way to define a shortcut for ssh URI scheme), working in conjunction with a `~/.ssh/config` file: see for instance http://stackoverflow.com/questions/9630937/can-not-add-user-with-gitolite/9633439#9633439 – VonC Mar 24 '12 at 16:17
  • thanks again, you are right, i was not allowed to push into the remote repository the way i did it. So i removed the one ssh-key which was before gitolite start and now it is working as discribed in the wiki. Sorry for the wrong comment!! – NewYearsEve Mar 24 '12 at 16:55