Re: How does gitosis know who the key belongs to
- From
Howard Miller <howard@e-learndesign.co.uk>
- Date
- Sep 25, 2009, 06:10 UTC
- Message-ID
- <26ae428a0909242310r259ccf5eya7c95b8f43fc5c23@mail.gmail.com>
- In-Reply-To
- <vpqskeckuto.fsf@bauges.imag.fr>
Hi,
I don't really understand the answers I have been given. Trying desperately not to "top post" see bellow...
2009/9/24 Matthieu Moy <Matthieu.Moy@grenoble-inp.fr>:
Show 18 quoted lines
> Heiko Voigt <hvoigt@hvoigt.net> writes: > >> On Thu, Sep 24, 2009 at 03:51:44PM +0100, Howard Miller wrote: >>> Gitosis obviously uses keypairs but the config file addresses the user >>> by name/host. How does gitosis connect the two together? Is it any >>> more complicated than the user detail at the end of the public key? > > The user@host at the end of the public key is mostly a comment. No > serious software would use it for authentication, since you can freely > edit it without changing the rest of the key. > >> Not much different. It uses the command feature of the authorized_keys >> file of ssh to limit access to the 'gitosis-serve' command which is >> given the username from the gitosis.conf as argument. > > ... the username -> key association being done in gitosis's > configuration itself (the key held in keydir/foobar is the one of user > foobar).
Yes, I realise that the association is done im gitosis' config file, but that is exactly my question - how does that association work?
To take a step back - I have to put a name (or a name@hostname) in the configuration file. How do I know what that should be in the general sense? When I create a key it doesn't ask me for the username I want so I see a disconnect here. Do I put a name, do I put name@hostname, does it matter and (again) how does it know which is 'my' public key? Is it the naming convention of the key or something magic? Plus, when I actually use gitosis, I am logging as the user 'git' so how does it know who I am? I am thoroughly confused by the whole thing. I'm probably missing something really obvious but, AFAIK, this is not covered at all in the docs.
Thanks!
Howard