I have setup a Gitlab strictly according to manual from the gitlab wiki. It works. I have a web access, I can create a project too (and git repo has been created after it). All is ok.
But when I try clone the newly created project repo with
git clone git@git.myserver.com:myproject.git
from the my development machine the server says that I need to enter password for the git user (this user have no password). I think it should auth me with key I provided.
My environment: I've successfully created the ssh keys on my dev machine, set the HOME environment variable to C:\Users\. Ssh is correctly authorize user with keys to other servers (and to this server too). Also I've added the generated keys for my git user.
Next command is also working fine from the local server user (this is according to manual too):
sudo -u gitlab -H git clone git@localhost:gitolite-admin.git /tmp/gitolite-admin
My authorized_keys file for the git user is like:
# gitolite start
command="/home/git/bin/gl-auth-command gitlab",no-port-forwarding,no-X11-forwarding,no-agent-forwarding,no-pty ssh-rsa <LONG_KEY_HERE> gitlab@odiszapc
# gitolite end
Should there be my user key in the authorized_keys file after I've added ssh key from gitlab web console? Guys, what I'm doing wrong?
That means that:
~/.ssh
directory)~/.ssh/authorized_keys
by gitlab (which seems to be the case here: addig your ssh key should trigger its publication by gitlab).This is similar to GitLab issue 900.
You could have copy-paste your key with linebreaks in it.
You will know more with a:
Note that all operations on the server are done as user 'git', which is why it falls back asking the
git
password. This is how gitolite works with ssh.As the OP mentions, the issue was about gitolite not being properly installed.
This is the kind of issue which should be detected by the "verification step" of GitLab:
It should produce, regarding gitolite (I have added the '
vvv
' and '^^^
' for emphasis):If it does not, then a re-installation of Gitolite is in order.
Okay, I think I've got it.
When I add key for the user from web interface, it hasn't been added to authorized_keys file. What I do is make full delete of the gitolite installation and then reinstall it according to native manual from the gitolite wiki. Now when i've add a key to user, this key is added to authorized_keys and all works fine now.