I installed gitlab on my servers at linode. All services of gitlab are working fantastic. I am able to login, create users, repos etc. But the problem I am facing is when I
On systems with SELinux enabled you should not disable SELinux as suggested in some answers.
To get along with the SELinux restrictions (iff they are the reason for the password prompt; check your /var/log/audit/audit.log
) change the security context for gitlab:
chcon -t user_home_dir_t /var/opt/gitlab/
chcon -t ssh_home_t /var/opt/gitlab/.ssh/
chcon -t ssh_home_t /var/opt/gitlab/.ssh/authorized_keys
(as suggested at the gitlab group)
To properly fix the selinux issues, use the following. Note that chcon is only temporary and will not survive a relabel or restorecon, so you should use semanage instead.
semanage fcontext -a -t user_home_dir_t "/var/opt/gitlab(/.*)?"
semanage fcontext -a -t ssh_home_t "/var/opt/gitlab/.ssh(/.*)?"
restorecon -rv /var/opt/gitlab
In my case, I had to add the remote repository with ssh as
git remote add gitlab ssh://git@your.project:222/git/repo_name.git
which made git not request me the password again. Note the use of ssh://
and port=222
.
I had a similar problem when I set the remote repository with the HTTP URL.
I changed it to use the SSH URL, and it worked fine:
git remote set-url gitlab git@gitlab.devekko.net:niccolox/cirm-website.git
I had the same problem but it was because my server only accept ssh login from users of "sshusers".
On /etc/ssh/sshd_config
I had the following line :
AllowGroups sshusers
In order to fix this issue, I added git to sshusers group:
$ sudo adduser git sshusers
And then it's working.
I tried many options but no success.
The only that resolved for me was osxkeychain helper
See the tutorial here.
The tutorial is from github, but works great for gitlab too.