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
  • 207,228
7_R3X
  • 1,191
  • 1
  • 16
  • 31

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
  • 660