tags:

views:

59

answers:

1

I just setup an git repository using gitosis. What I can't figure out is how to add other users. All tutorials I find only says "gather their public SSH keys".

First of I tried to create the locally on my machine (not server) but I kinda figured that's the wrong way to go.
Now I've tried to create public key using PuTTy keygen on a windows machine, saved the key and put it in to the keydir under gitosis-admin directory.
I've tried both git clone git@cn-linuxdev.****.***:tungsten.git and git clone tor@cn-linuxdev.****.***:tungsten.git where tor is the name of the file in keydir.

The error generated in auth.log is Failed password for git from 192.168.0.158 port 63305 ssh2

From the windows client I've also tried the password set during setup sudo -H -u git gitosis-init < /tmp/id_rsa.pub.
This ssh key comes from my local computer. And this password works from there but not the windows client.

I don't quite understand how the ssh-keys work but I would guess they are bound in someway to the computer they are generated on.

So have anyone managed to set up gitosis with other users and windows users? How did you get it to work?

+1  A: 

Each user should generate his/her own couple of public and private ssh key.

See this GitHub help page.
Then they need to send you the content of their $HOME/.ssh/id_rsa.pub for you to call gitosis-init with to edit the config file appropriately and check in (and push) the keys in keydir/..
(thank you, ebneter, for the correction).
For instance, in this mantisbt gitosis management page:

$ cat > keydir/jsmith.pub
...
^D

$ git add gitosis.conf keydir/jsmith.pub
$ git commit -m "Added 'myplugin' repository and 'jsmith' user."

$ git pull --rebase    # make sure we have the latest updates from the server
$ git push

Note: all user side operations (like ssh-keygen -t rsa -C "[email protected]" or $HOME/.ssh/id_rsa.pub) need to be done or evaluated in a Git bash environment, not in a Dos shell.

VonC
Thanks. The key for getting it to work on windows matchings was to create the keys in the git env using msysgit
fredrik
call init? With all? The docs say to check in new ones and update the config file.
Thorbjørn Ravn Andersen
@Thorbjørn: true (I hadn't made a gitosis config recently), but the idea remains to ask for the user to generate their public/private ssh keys in their own msysgit bash session.
VonC
@VonC: You should probably fix that, actually; the standard way to do it is edit the config file appropriately and check in (and push) the keys in keydir/. (I do this *a lot* as I maintain a gitosis system. :-) )
ebneter
@ebneter, @Thorbjørn: I have updated and fix the "adding a new user" part.
VonC