title: Tomcat user not relaying SSH key properly with Jenkins and Gitosis
body: <p>I have a new setup of Jenkins running as a WAR deployment on a Tomcat6 server in Ubuntu.  I also have, on that same server, and install of Gitosis for all of my repositories.</p>
  
  <p>I have been working on getting Jenkins to build the repositories, but have been unsuccessful in getting the SSH public key setup for Tomcat in my repo server.  I started out by logging in as Tomcat with the command <code>sudo su - tomcat6</code> and ran <code>ssh-keygen -t rsa</code>.  After that I copied the id_rsa.pub key to the keydir directory in the gitosis repo.</p>
  
  <p>So here is the basic rundown of my command:</p>
  
  <pre><code>sudo su - tomcat6
  ssh-keygen -t rsa -C "tomcat6@trogdorsrv"
  exit # Get back to my user
  sudo cp /usr/share/tomcat6/.ssh/id_rsa.pub ~/gitosis-admin/keydir/tomcat6@trogdorsrv
  </code></pre>
  
  <p>My next step was to open the gitosis.conf file in the gitosos-admin repo and add my new user as the administrator of the repos:</p>
  
  <pre><code>vim ~/gitosis-admin/gitosis.conf
  </code></pre>
  
  <p>gitosis.conf:</p>
  
  <pre><code>[group buildserver]
  writable = repo-name
  members = tomcat6@trogdorsrv
  </code></pre>
  
  <p>I also have other members and the repo-name is the name of my actualy repo.  I then pushed the gitosis-admin repo up to the remote and commited some data to it from another repo user.  </p>
  
  <p>I am able to read and write to my repo from the other users, but when I try to use Tomcat I get an error that it can't login.  I tried logging in as Tomcat again and doing a git clone manually so that the git server's fingerprint was added to the known_hosts and when I did the clone it asked me for my git users password.</p>
  
  <p>Soooo am I doing something wrong to get Jenkins SSH keys into Gitosis?</p>