I have just installed GitLab.
I created a project called project-x.
I have created few users and assigned it to the project.
Now I tried to clone:
The same solution for Windows machine:
Clone should be successful without password require.
On my Windows 10 machine it was because the SSH_GIT environment variable wasn't set to use the putty plink I had installed on my machine.
My problem was that I had a DNS entry for gitlab.example.com
to point to my load balancer. So when I tried command ssh git@gitlab.example.com
I was really connecting to the wrong machine.
I made an entry in my ~/.ssh/config
file:
Host gitlab.example.com
Hostname 192.168.1.50
That wasted a lot of time...
After adding the new SSH Key in GitLab, check if you have "git" group included in SSHD AllowGroups
(for Debian /etc/ssh/sshd_config
). If not, add it and restart sshd (systemctl restart ssh
).
Test it with ssh -vT git@192.168.8.2
as suggested above.
Not strictly related to the current scenario. Sometimes when you are prompted for password, it is because you added the wrong* origin format (HTTPS instead of SSH)
HTTP(S) protocol is commonly used for public repos with strong username+pass
SSH authentication is more common for internal projects where you can authenticate with a ssh-key-file and simple pass-phrase
GitLab users are more likely to use the SSH protocol
View your remote info with
git remote -v
If you see HTTP(S) address, this is the command to change it to SSH:
git remote set-url origin git@gitlab.my_domain.com/example-project.git
You may usually if you have multiple keys setup via ssh on your system (my device is running Windows 10), you will encounter this issue, the fix is to:
Precondition: Setup up your SSH Keys as indicated by GitLab
Please note, there is a space before the second line, very important to avoid this solution not working.