title: Gitolite usernames in authorized_keys file
body: <p>I'll try to explain my scenario the best I can:</p>
  
  <p>I'm using gitolite in a debian squeeze server and there are 3 users who can access and work with the repositories:</p>
  
  <ul>
  <li><code>alex@workbox</code> </li>
  <li><code>alex@homebox</code></li>
  <li><code>katy@workbox</code></li>
  </ul>
  
  <p>The above are the corresponding usernames and hostnames of three Ubuntu boxes (Alex works from two locations).</p>
  
  <p>The first thing I did was to add <code>alex@workbox</code> to the gitolite:</p>
  
  <ol>
  <li>Alex generated his ssh key using ssh-keygen</li>
  <li>I copied his ssh key as alex@workbox.pub in "keydir" folder of my local gitolite-admin cloned repo</li>
  <li>Modified conf/gitolite.conf file of my local gitolite-admin cloned repo in order to let alex@workbox RW access to a repository:<br>
  <code>repo    project1</code><br>
  <code>RW+     =   alex@workbox</code></li>
  <li>Did the usual: 
  <ul>
  <li><code>git add .</code> </li>
  <li><code>git commit -m "Added alex@workbox"</code> </li>
  <li><code>git push</code></li>
  </ul></li>
  </ol>
  
  <p>When Alex tried to clone the project1 repo an error showed up saying that access for user "<code>alex</code>" was denied.<br>
  So, I logged in into the server and opened <code>/var/lib/gitolite/.ssh/authorized_keys</code>.<br>
  The first part of the file was this:</p>
  
  <pre><code>command="/usr/share/gitolite/gl-auth-command alex",no-port-forwarding,no-X11-forwarding,no-agent-forwarding,no-pty ssh-rsa...
  </code></pre>
  
  <p>So I manually replaced <code>alex</code> with <code>alex@workbox</code>, saved the file and this time Alex was able to clone the repository and work with it without any problems.</p>
  
  <p>Then I did the same above steps to add Katy and after the push to <code>gitolite-admin</code>, I opened again the <code>authorized_keys</code> file and saw that gitolite replaced the "<code>user@hostname</code>" with "<code>user</code>".<br>
  So it had <code>alex</code> instead of <code>alex@workbox</code> and the same for <code>katy</code>.<br>
  Then I had to manually replace that again and save the file.
  I saw that for every push that I do for the <code>gitolite-admin</code> repo gitolite replaces every "<code>user@hostname</code>" with "<code>user</code>" in its <code>.ssh/authorized_keys</code> and this way make the repositories inaccessible for the users.</p>
  
  <p>How can I do to make gitolite keep the "<code>user@hostname</code>"?<br>
  Is there a configuration to make on the server or a configuration change on my local cloned <code>gitolite-admin</code> repo?</p>