GitLab SSH keys stopped working

自作多情 提交于 2019-12-05 04:04:36

If keys that you add to GitLab aren't making it into .ssh/authorized_keys:

  1. Make sure that sidekiq is running. Keys are added to gitlab-shell in a Sidekiq worker, so if Sidekiq is down or backlogged, they won't make it in. You can check this in the output of ps -fu git and by checking the "background jobs" tab on the admin page.
  2. Ensure that GitLab can execute gitlab-shell properly. The Sidekiq worker adds keys by exec'ing a gitlab-shell process. In particular, this won't work if the ssh_user setting is incorrect in gitlab.yml, or if gitlab-shell is installed to a location other than ~/gitlab-shell for that user.
  3. Verify that the server's /home partition isn't full. If the disk that the authorized_keys file is stored on fills up, key appends with fail! This one has gotten me a few times. Use df -h /home to see if you still have room.

Check your logs for error messages from gitlab-shell: depending on the problem, error messages could appear in unicorn's or sidekiq's logs.

Well, now i am under 5.1 i did it step by step 4.1 > 4.2 4.2 > 4.3 and finally everything is up and running.

Just for 4.1 users to know - > one of the developers added a bad key including the $#root... and this is what broke the sync.

Thanks for you help

Greg Lund-Chaix

I just ran into this problem when I switched the GitLab server from HTTP to HTTPS. Everything looked fine on the web server - logins, etc. were all working normally but git@gitlab SSH connections were failing.

After looking at #2 in https://stackoverflow.com/a/19637026/2162639 (above) I discovered that I needed to modify the gitlab_url setting in /home/git/gitlab-shell/config.yaml to use https://gitlab.server.fqdn instead of http://gitlab.server.fqdn. I changed that setting, restarted the gitlab service and everything was working normally.

Had to delete all previous keys for the host. Problem is gitlab takes any older keys and if the match does not exist, it fails there. Your working key may be listed later in order and never picked.

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!