I am using gitosis for repository management. I have two other keys that work perfectly. I've recently added a third key.
All keys work when I SSH into the machine (I get the error mentioned here as normal, and the server's auth.log says "Found matching RSA key..."). However, when I run the command:
git clone -b <branch> ssh://gitosis@<server>/<project>
with the new third key the server's auth.log shows "Failed publickey for gitosis...". The same "git clone" command works for the other keys.
The permissions on the .ssh files are set correctly since I am able to SSH into the machine.
Both machines are Ubuntu.
What would cause the "git clone" to be rejected, while the SSH is accepted?