Server Fault is a question and answer site for system and network administrators. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I have a working installation of Gitosis, but I'm wondering how the gitosis-serve command ever gets invoked! From all I can understand, when you connect through SSH as the git user (using git@host), the script gets invoked by the script generated by setuptools in /usr/bin/gitosis-serve, which then launches git-shell.

However, how is the git user's login connected to /usr/bin/gitosis-serve?


share|improve this question

When you add an SSH key to gitosis-admin.git repository it is automatically checked out during the commit and the ~/.ssh/authorized_keys file for the gitosis user is updated to call gitosis-serve for the given SSH key. What repositories the user can actually manage is of course dependent on which repositories in the gitosis.conf that they have been given access.

share|improve this answer
up vote 0 down vote accepted

I found the answer here. Basically, the /home/git/.ssh/authorized_keys file (generated by gitosis-init) maps each registered key to the gitosis-serve command!

share|improve this answer
So basically what I had said :) – Jeremy Bouse Sep 3 '13 at 16:42
@JeremyBouse: if you look at the dates, you can see I answered before you did... – André Caron Sep 9 '13 at 17:07

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.