5

I'm trying to setup Gitlab server. It flashes an error "Fingerprint cannot be generated" while adding ssh keys. I googled for the solutions and found a few possible problems that could cause this problem.

First was to ensure proper access from SELinux. Since I don't have SElinux installed, it can't be a problem.

Second was to make sure that ssh-keygen is installed and the keys generated do not have a pass phrase associated to it. Checked it and no issues.

Third was to check that user git can access the tmp directory created by Gitlab. I checked that too.

This is the link I followed to set gitlab.

muru
  • 193,181
  • 53
  • 473
  • 722
7_R3X
  • 1,141
  • 1
  • 16
  • 31
  • The permissions of `/tmp` should be `1777`. All users can write there. Are you sure you have diagnosed your problem correctly? The `git` user needs access to a `tmp` directory inside the Gitlab source dir structure afaik & that may have to be adjusted, but not `/tmp` ? – Zanna Sep 25 '16 at 06:40
  • @Zanna I didn't know that. Anyway, I just checked for `tmp` inside Gitlab, made it accessible and it's still the same. Any other possible reason? – 7_R3X Sep 25 '16 at 08:01
  • I don't know, but what makes you think it's a perms issue? Could you [edit] your question with a link to the instructions you're following or add more detailed error messages? – Zanna Sep 25 '16 at 08:03
  • @Zanna : Just changed the question. I'm not sure where to find the logs as I'm new to it. – 7_R3X Sep 25 '16 at 08:38
  • 1
    +1 to your question & hope someone can answer it. – Zanna Sep 25 '16 at 08:48

1 Answers1

6

The problem is that the version of Gitlab installed from those instructions (version 6.9.2) is too old (current version is 8.14) - ssh-keygen was then outputting MD5 based Fingerprint hashes; the default is now SHA256. The solution, as garnered from - Fixing gitlab's "Fingerprint cannot be generated" error - is as follows:

  • Edit <path-to-gitlab>/app/models/key.rb
  • Change this line

cmd_output, cmd_status = popen(%W(ssh-keygen -lf #{file.path}), '/tmp')

  • With this one

cmd_output, cmd_status = popen(%W(ssh-keygen -E md5 -lf #{file.path}), '/tmp')

  • Restart Gitlab
AnthonyK
  • 631
  • 8
  • 16