Understanding Gitosis user repo access

307 views Asked by At

I have set up git and gitosis at my Ubuntu v-server. Creating new repositories on the server, checking out gitosis-admin.git and pushing an altered conf and new keys (otheruser.pub for example) works fine. The authorized_keys file gets updated as well. But now I got stuck.

If I try to push an existing (locale machine) repository to a bare repository on the myserver.com with a different user then 'git' it doesn't work.

Example (SSH):

[email protected]:/my/path/to/xyzrepo.git 

works, but

[email protected]:/my/path/to/xyzrepo.git 

doesn't...

I assumed that gitosis creates temp users or something similar on the machine. Is that correct?

1

There are 1 answers

3
larsks On BEST ANSWER

With gitosis you always use the same userid (git@...). You are identified by the ssh key you're using. You'll note that commericial Git hosting services like GitHub and Gitorious work the same way.

I want to highlight djs's comment: you should not be able to log into the git user account with a password. Gitosis relies on the ssh authorized_keys files to operate correctly, and this is only used when someone authenticates using ssh keys.