I am trying to setup Gitlab on my server (Centos 6.3) and facing some problems with Gitolite setup.
I have created two users (as mentioned in guide :)). gitlab and git. Created ssh keys for gitlab and copied the public key (gitlab.pub) to git’s home. And set it up with gitolite setup -pk gitlab.pub.
Now when I am trying to open ssh session from gitlab account it asks for password. Commands are as follows
ssh git@localhost
git@localhost's password: #asks for password here
No errors or warnings. Copying of test repo fails with same problem. Can anyone help me to find the problem.
Guide I have used are
1. Gitlab Installation (for ubuntu)
2. https://gist.github.com/4362544 (centos specific)
Can you post a link to the guide? Maybe I can see which step you missed.
But in general you need to create your own key pair, for the user you’re trying to ssh to git from and then put its public key to gitolite configuration.
From your guide, these are the steps that have to do with key auth:
So, check if you have
~gitlab/.ssh/id_rsa.pub, check if you have~git/gitlab.pub.Then, the key-only connection will work only from
gitlabuser, so make sure you’re tryingssh git@localhost, which being logged in as usergitlab.If that’s what you’re doing you can look in
/var/log/messagesor/var/log/syslogfor a reason of key rejection. Also, verify that key-based authentication is enabled in/etc/ssh/sshd_config, if not – enable it and restartsshd.