3

I have a Gitolite server running on EC2 that works pretty well. I've added users before and have no problem adding repositories.

My Macbook Pro can push code to a repository with no problem (it has the RW+ permission on the repo). I've also added a second computer to the repository with R permissions so I can clone it.

The issue is, I keep getting "Permission Denied (public key)" when trying to clone the repo. When I SSH into the server with Gitolite and look at the user "git"'s authorized_keys file, I do see the public key of the second computer, so I'm not sure what the problem is-- it looks like it is getting added just fine. The public key of the second computer is also located under keydir with the appropriate name (raspberry.pub)

Here's my gitolite conf, with some info changed to protect privacy:

repo    statistics-app
        RW+     =   andrew
        R       =   raspberry

Note: "andrew" can push code and clone the repo just fine, but the user "raspberry" cannot. What's the issue?

1 Answer 1

3

You should have, on your second computer, a ~/.ssh/config file with:

host gitolite-raspberry
     user git
     hostname raspberry
     identityfile ~/.ssh/raspberry

(See, for instance, "Can not add user with Gitolite")

You need to check if ssh gitolite-raspberry answers you with the Gitolite rights associated with the raspberry ssh account.

If not, ssh -vvv gitolite-raspberry will provide you with clues.


The OP Andrew M reports a right issue:

I didn't set the permissions of the folder I was cloning into, so I "sudoed" the git command.
The root user on the Raspberry Pi wasn't allowed to clone, so it failed.

5
  • Actually, in my case, it turns out it was a stupid mistake on my part. I didn't set the permissions of the folder I was cloning into, so I "sudoed" the git command. The root user on the Raspberry Pi wasn't allowed to clone, so it failed.
    – Andrew M
    Jun 10, 2012 at 17:56
  • @AndrewM ok, I have included it in the answer. I would like to know, though, if you are using a ~/.ssh/config file for your ssh repo addresses. I find those very convenient to be sure to use the right ssh user and ssh keys.
    – VonC
    Jun 10, 2012 at 18:04
  • At the moment, I am not. I don't believe I am on any of the computers with permission to access the Git server...
    – Andrew M
    Jun 10, 2012 at 18:17
  • @AndrewM: Note, the config file I am referring about is on your client. Not on the Git server. You would use it for your remote repo ssh addresses.
    – VonC
    Jun 10, 2012 at 19:09
  • Yeah, that was what I was referring to. There definitely isn't one on the server and AFAIK there are no config files on any of the clients.
    – Andrew M
    Jun 10, 2012 at 20:50

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.