Fingerprint has already been taken gitlab

learn_develop picture learn_develop · May 8, 2014 · Viewed 41.7k times · Source

I formatted my Windows 7 laptop and in an attempt to have git setup working again, I installed git and source tree application.

I deleted the SSH Key from gitlab and regenerated the key using ssh-keygen. But when I try to add the SSH Key at gitlab, it throws the following exception :

Key is invalid
Fingerprint has already been taken
Fingerprint cannot be generated

Because of which I am unable to clone the git repository from source tree application since it is unable to authenticate the SSH key.I followed queries at google groups of gitlab but none of them seem to resolve my issue. Is there any workaround or steps to get the SSH key accepted by gitlab?

Answer

Unkas picture Unkas · Oct 4, 2018

Gitlab can use your ssh-key in another account of your past projects for somehow - so, easiest way to solve this problem is to create new ssh-pair, add it to ssh-agent and add id_rsa2.pub to your gitlab account.

$ ssh-keygen -t rsa -b 4096 -C "[email protected]"

When it ask:

Generating public/private rsa key pair. 
Enter file in which to save the key (/home/<NAME>/.ssh/id_rsa):  

Please enter /home/<NAME>/.ssh/id_rsa2

$ ssh-add ~/.ssh/id_rsa2