Python – How is gitosis-serve invoked

gitpython

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 serve.py 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?

Thanks

Best Answer

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.