Book Image

Gitolite Essentials

By : Sitaram Chamarty
Book Image

Gitolite Essentials

By: Sitaram Chamarty

Overview of this book

Table of Contents (19 chapters)
Gitolite Essentials
About the Author
About the Reviewers

Users with multiple key pairs

Some users have multiple key pairs. For instance, they use a laptop as well as a desktop at work. Some may have another machine at home, or work directly on a server.

You might think it's best to use the same key pair on each machine—after all, they all belong to the same user—but this is not a good idea. The risk of a private key compromise increases with the number of machines that it is installed on, and that would not be a good thing at all.

As a result, Gitolite allows a user to have multiple public keys. There are in fact two ways to associate multiple public key files to the same Gitolite user.

The first way is to use subdirectories. Here's an example tree structure of the gitolite-admin repository showing a set of keys in the keydir subdirectory:

As you can see, there are two files called Both of these will generate lines in the authorized keys file as described earlier, with the username set to carol. Whichever key she uses, Gitolite will see...