W access for gitolite-admin DENIED to user

I’ve been trying very hard to get gitolite working. I used the package approach and am able to do a first “git push” with a first user to the server. After that, if if I add a key and try to push something again, I get an error saying “W access for gitolite-admin DENIED to mike”- note that it’s supposed to be using the gitolite user- not my username. I guess this is because I’m adding private keys for both users in my .bash_profile. (I’m using msysgit)…

Any ideas?

  • Git commit asking for comment
  • View a file in a different Git branch without changing branches
  • git still shows files as untracked despite .gitignore and rm -r --cached. What did I do wrong?
  • How can I get git to show colored output during hook output?
  • git rev-list hangs infinitely
  • How to use git-svn properly, svn-ers checkout svnrepo and git-ers clone gitrepo, committing carelessly
  • Thanks a lot!

  • How do I setup DiffMerge with msysgit / gitk?
  • How can I create a GIT Stash from a Commit?
  • SSH Failure using Git For Windows
  • Git internals: Modifying `git-merge-one-file` to not use working tree
  • Using Git or SVN with a web server
  • How to apply SVN diff to Git?
  • 2 Solutions collect form web for “W access for gitolite-admin DENIED to user”

    I guess this is because I’m adding private keys for both users

    True, you should use a dedicated public/private key for the gitolite user, the one which is also used for ssh access.
    You can confirm it by looking in the gitolite logs (in ~gitolite/.gitolite/logs)

    Using multiple keys is done through a config file.
    See as an example “users are asked for password while using gitolite”.
    The %HOME%/.ssh/config file could contain something like:

    HostName gitoliteserver 
        User gitolite
        IdentityFile ~/.ssh/gitolite
    
    Host mikegitolite
        HostName gitoliteserver 
        User mike 
        IdentityFile ~/.ssh/id_rsa
    

    Don’t forget to define HOME is you are on Windows: it isn’t defined by default)


    The OP Mike Gagnon confirms in the comments the following config is working:

    host gitolite 
    user gitolite 
    hostname myhost 
    port 443 
    IdentityFile ~/.ssh/gitolite
    
    host edison 
    user gitolite 
    hostname myhost 
    port 443 
    IdentityFile ~/.ssh/mike
    

    I had a similar problem in that I could only make one push to a new gitolite repo, then I lost access.
    I was able to fix this by adding my username to the .conf file on the first push:

    %> cat conf/gitolite.conf repo gitolite-admin
    RW+ = git-admin myusername

    Git Baby is a git and github fan, let's start git clone.