Search code examples
gitubuntupasswordsgitolite

ubuntu server with gitolite password


I am trying to setup gitolite on Ubuntu Server! It seems to work as I could clone gitolite-admin

But when I try to issue the command on the client

git clone gitolite@ubuntu-server:testing

It ask for a password for gitolite, but my ssh password that I configured on the client is not accepted

Have I done anything wrong somewhere?

I did copy the .pub to the server and ran gl-setup without problems

NB: I am very green with git


Solution

  • Check the content, on the server gitolite account, of:

     ~/.ssh/authorized_keys
    

    You should see your public key within a gitolite start / gitolite-end:

    #more authorized_keys
    # gitolite start
    command="/home/gitolite/bin/gitolite-shell gitoliteadm",no-port-forwarding,no-X11-forwarding,no-agent-forwarding,no-pty ssh-rsa ABCAB3NzaC1yc2EAAAADAQABAAABAQCxy5Y1epgjph3h439etAognIP4rlpDlD0OBh2rh+9DHMwlMad04zb3Tah5HQ
    10Zg7mFWvltZlIBdhk5cBr3/mN1dNiRFspKwD2Z0yQaaI23zjHnXRAgLV76SOImICUt9CfCtGOy6jQH+2x4j921DL2cT8Ib+RslhBUEUdc3qNvOQSNhIz2qTVHJ676ohGFiqitgswIVIk6WRS+fERx6JFy9o7rLnnOCrozHYU271TwFgYqfNS7TuV4ZFwTP04hDGN+YALjvcQ0KGQGY/7qok+h5nHoRh9RDTeSJ2gDK2M4QPrTCzkCa0ebCexP2lR9G0iXYcClzXitttKDH7cls0j Gitolite Admin access (not interactive)
    # gitolite end
    

    Make sure to use the latest gitolite (V3), which is the case if you have:

    /path/to/gitolite/bin/gitolite-shell
    

    (you can execute: gitolite-shell xxx on the server to check what version you are using)

    Make also sure to not protect (at least at first) your private ssh key with a password.

    If it keeps asking you for a password, edit your question with the content of:

    ssh -vvv gitolite@ubuntu-server
    

    The OP adds:

    If I run git clone morten@ubuntu-server:testing and type my password everything works well... But now I can't seem to push anything to the repository

    That means now the ssh part is running properly, however don't forget your first push must be a:

    git push origin master
    

    (see "git push origin master:refs/heads/master what does this do")

    That is because the default push policy (which might change soon) is to push matching branches (and if you didn't push anything yet, there wouldn't be a master branch on the remote repo yet)

    The other trick is to make sure you are on a branch before pushing

    git checkout master
    git push
    

    (and not trying to push while you are in a detached head mode)