Hacker News new | ask | show | jobs
by captn3m0 819 days ago
> Everyone’s username is git. How does the server distinguish who is who?

I used to run a small gitolite/redmine installation for a few years. I found its solution to this problem very "unix"-y[0] - Just manage the `authorized_users` file to set the `command=` for each user individually. The file looks like:

    command="[path]/gitolite-shell sitaram",[more options] ssh-rsa AAAAB3NzaC1yc2EAAAABIwAAAQEA18S2t...
The gitolite-shell script gets the `$SSH_ORIGINAL_COMMAND` from sshd, and uses that to pick the repo name/path. Then it uses the $ARGV to get the actual user. It can then decide on access rules.

For branch/tag restrictions, it uses git hooks that are setup at repo creation.

[0]: https://gitolite.com/gitolite/glssh.html