Search code examples
gitgitolite

How to add multiple pub files for the same username in gitolite?


I'm new at using gitolite and have been doing some tests and there is one thing I don't understand. When a user generates its key (say, "pablo") the id_rsa.pub needs to be renamed to "pablo.pub" because it says in the file content pablo@pc10 and hence the username needs to match the name of the file. This work.

Now the problem is that there is another username pablo in another pc (pc12). So I obviously can't add both keys to the keydir as they both have the same file name. I have tried to rename them to [email protected] and [email protected], but this doesn't work (whenever they try to clone the repository it asks for the gitolite3 password, which should not happen). I have also edited the conf file to reflect that the user is pablo@pc10 and pablo@pc12 after the RW+ = sentence.

My question is, what am I doing wrong? How do I add multiple keys for the same username on different machines?


Solution

  • Since the keys are for two different users who have the same name, the easiest solution would be to add something to the public key files' names that makes them unique again, such as the surname.

    The name of the file is totally independent of the local user name or the contents; the connection is made solely based on the contents of the private key that is used for the SSH connection. In that regard I find the gitolite documentation a bit misleading.

    You just have to use the new names in the gitolite configuration as well.