Search code examples
gitubuntusshgitosis

Understanding Gitosis user repo access


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):

git@myserver.com:/my/path/to/xyzrepo.git 

works, but

otheruser@myserver.com:/my/path/to/xyzrepo.git 

doesn't...

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


Solution

  • 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.