Search code examples
gitgitosis

How can I add users to my new gitosis project?


As a fresh Git user, I tried to install git on a server following this guide: Hosting Git repositories, The Easy (and Secure) Way. For... like 3 days in a row.

Here was the problem:

I followed that guide exactly. But when I came to the 'Creating new repositories' section, I was blocked. I simply can't understand how can you add users to a project. I mean, okay, I need a SSH key. But for all users? Or just for admin? If is for all users, how can I add another user?

The second question is about the same 'chapter'. The example is like this:

[group myteam]
members = jdoe
writable = free_monkey

Ok, I can add a member, called jdoe. But what is that name? Where do I get that name? Is it my local cygwin user? Is it a Linux user? My cygwin user is some kind of email address. If that is the user, how can I add more users? I mean how can I find out what any other users are out there ?

So after few days of trying and trying and... trying, I kinda quit because I found a great virtual machine appliance from turnkey. But the problem was... I didn't know how to add projects! I searched on their site, I found a script that add projects (the script is giving me an error, btw, but it works) but I'm back to square one: how the hell I add more users? Because right now it is a public server, with full rights. It is not a big problem right now because I run it in a virtual machine and it's only local.

Maybe you ask me why I don't use that VM? Because I kinda want to put it online and give access to several persons. So I think to move it to my VPS. But because I didn't succeed to install in a VM, I sincerely doubt that I can install it in a VPS.

(Please don't suggest me to move on GitHub.)


Solution

  • A user in Gitosis is identified by the name of the pubkey file, i.e. if you had a pubkey file called foo.pub, then the user is called foo -- and, naturally, all the users you have are simply the SSH pubkeys you have on your Gitosis installation.

    All users must have their SSH pubkey on the server, as all of them use the git user on the server to push their changes to the repositories they are allowed access to.