The form contains the following error fingerprint has already been taken

Fingerprint has already been taken gitlab 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, […]

Содержание

  1. Fingerprint has already been taken gitlab
  2. 12 Answers
  3. Search
  4. Table of Contents
  5. Workaround: One SSH key pair per GitLab.com account
  6. Configuring SSH agent to use the new key
  7. Chicken and egg scenario: git clone
  8. Fingerprint has already been taken gitlab
  9. 14 Answers 14
  10. Trending sort
  11. Setting deploy key in some cases fail with HTTP 400: <«fingerprint»:[«has already been taken»]>#19
  12. Comments
  13. Fingerprint has already been taken gitlab

Fingerprint has already been taken gitlab

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 :

Because of this I am unable to clone the git repository from the source tree application since gitlab 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?

12 Answers

In my case; the public key i was trying to add was already used with ‘work’ Gitlab account and i received the said error upon trying to use the same key with ‘personal’ Gitlab account.

Solution — Add another public key on the same machine and use that with ‘personal’ gitlab account (both on same machine).

navigate to .ssh folder in your profile (even works on windows) and run command

when asked for file name give another filename id_rsa_2 (or any other). enter for no passphrase (or otherwise). You will end up making id_rsa_2 and id_rsa_2.pub

use the command

copy and save key in ‘personal’ Gitlab account.

create a file with no extension in .ssh folder named ‘config’

put this block of configuration in your config file

now whenever you want to use ‘personal’ gitlab account simply change alias in git URLs for action to remote servers.

for example instead of using

git clone [email protected]gitlab.com.

git clone [email protected]gitlab_2.

Источник

Search

Here’s the situation:

  1. The easiest and most secure way to interact with Git repos hosted on GitLab is over the SSH protocol.
  2. While most people only use one GitLab.com account, a freelancer or consultant might need to work with repos from multiple accounts.

If that freelancer attempts to upload their public SSH key to multiple accounts, they’ll get the following error message from GitLab:

Assuming they don’t want to use password-based authentication over HTTPS as a workaround, how can our friendly freelancer get SSH working?

Table of Contents

Workaround: One SSH key pair per GitLab.com account

The solution is to use a different SSH key pair with each GitLab.com account. How do you do it?

  1. Generate a new SSH key pair. (Detailed instructions ).
  2. Add the SSH key to your GitLab account. (Detailed instructions ).

How will SSH know which key to use for a given repo? Since Git 2.10, you can use Git’s core.sshCommand option to configure how Git invokes the ssh command. As with all Git options, you can set it globally, or per repository. Let’s set it to point SSH at the key we just created.

  1. Open a terminal and make sure you’re in the repository that needs configuring.
  2. Run git config core.sshCommand «ssh -i

/.ssh/id_MY_KEY_NAME_HERE -F /dev/null»

The -i tells ssh which “identity” file to use for this command.

Now try running git pull . You should be prompted for the private key’s password and the pull should finish successfully. You did it!

Configuring SSH agent to use the new key

If you weren’t prompted for the password and the git pull operation failed, you’re probably using an SSH agent. The agent likely tried to use your default SSH key and it didn’t fit the lock. That default identity is usually “id_rsa”.

Fortunately, the solution is simple: Tell SSH Agent about your new key using ssh-add . For example, if your new key is called id_yellowbanana and it’s stored in

/.ssh , the command would like like this:

Bash:

PowerShell:

If you’re on Windows and it doesn’t know where

is, try this instead from PowerShell:

Next, list the keys your agent is managing with ssh-add -l and see if the new key is listed. It should be there.

Try running git pull again. If your agent is configured property, you should be in business.😎

Chicken and egg scenario: git clone

If you’re cloning a real live chicken, you don’t have a chicken and egg scenario. If you’re cloning a GitLab repo over SSH and you want to use an alternate identity, you do.

Jokes aside, what if you haven’t even cloned the repo yet? How do you tell Git which SSH identity to use?

You can temporarily set the GIT_SSH_COMMAND environment variable.

Bash:

PowerShell:

Then configure core.sshCommand on the repo like we did earlier.

That was easy! Now you still have the convenience and security of SSH, and you’ve got it across all your GitLab accounts.

Ty Walls
Digital Construction Worker

Ty Walls is a software engineer in love with creating, learning, and teaching.

Источник

Fingerprint has already been taken gitlab

14 Answers
14

Trending sort available

Trending sort

Trending sort is based off of the default sorting method — by highest score — but it boosts votes that have happened recently, helping to surface more up-to-date answers.

It falls back to sorting by highest score if no posts are trending.

Switch to Trending sort

In my case; the public key i was trying to add was already used with ‘work’ Gitlab account and i received the said error upon trying to use the same key with ‘personal’ Gitlab account.

Solution – Add another public key on the same machine and use that with ‘personal’ gitlab account (both on same machine).

navigate to .ssh folder in your profile (even works on windows) and run command

when asked for file name give another filename id_rsa_2 (or any other).
enter for no passphrase (or otherwise).
You will end up making id_rsa_2 and id_rsa_2.pub

use the command

copy and save key in ‘personal’ Gitlab account.

create a file with no extension in .ssh folder named ‘config’

put this block of configuration in your config file

now whenever you want to use ‘personal’ gitlab account simply change alias in git URLs for action to remote servers.

for example
instead of using

git clone [email protected]gitlab.com:…………..

git clone [email protected]gitlab_2:……………

Источник

Setting deploy key in some cases fail with HTTP 400: <«fingerprint»:[«has already been taken»]>#19

For further investigation:

The text was updated successfully, but these errors were encountered:

Haven’t seen this since #1 has been implemented. Closing it then.

Hey. A similar problem on v4.
Added a key to a group with 2 projects. As a result, the key was added only to 1 project, and then the error.
failed — expected code(s) [201], got code 400 & body: ‘b’<«message»:<«deploy_key.fingerprint»:[«has already been taken»]>>»

common_settings:
..deploy_keys:
. rsa-key-20201022-ssh:
. key: «ssh-rsa AAAAB3NzaC1yc2EAAAABJQAAAgEA5y29aeWBhSFNBwopdzN (. ) rsa-key-20201022»
. title: rsa-key-20201022-ssh
. can_push: false

command:
gitlabform test_12.10.6

test_12.10.6 — name of group

Thanks @razumv ! I’ll try to reproduce it.

I was not able to reproduce it on the latest GitLab 13.5.1 with a simple test I added in #131 .

What GitLab and GitLabForm versions are you using, @razumv ?

I see this too on 13.8.4-ee . In my case I am trying to add a deploy key already defined in other projects from another group.

I see this on GitLab 13.12.5-ee with GitLabForm v1 as well. Can’t assign two projects with the same deploy key.

@jccl : please try using v2. v1 is not supported anymore.

Generally I still cannot reproduce this issue with the latest v2.1 and latest stable Gitlab, see https://github.com/egnyte/gitlabform/runs/2978563292?check_suite_focus=true .

I appear to have this same issue — We are running Gitlab 14.0.5-ee , running 2.1.1 of Gitlabform.

In my scenario, I created a new deploy key that I applied to a single project, then configured gitlabform to push it over a group. All projects failed, so I removed the key.

I ran gitlabform again, which applied the key to one project, then failed for the remainder with HTTP 400:

Please let me know if I can provide any more detail

Thanks @owindsor ! This may allow me to reproduce it but I have a few more questions.

What do you mean by «All projects failed, so I removed the key.»? Was that single project that had this key already part of that group? How did all the projects fail? How did you remove the key?

@gdubicki The process that I followed was;

  • Manually create a key and assign it to a single project.
  • Discover gitlabform, install and create a config to apply to all projects in the group, execute and receive the ‘fingerprint’ error. The group contains 65 projects in total.
  • Manually remove the key from the project, then use gitlabform to apply across the full group. A single project in the group got the key, the other 64 complained with the ‘fingerprint’ error.

My takeaway was that the application can work (at least for a single project) so my configs and tokens were valid.

I have checked this and frankly I am surprised that the current trivial code works at all, dealing successfully with many kinds of edge cases that you can encounter with deploy keys and failing only rarely. :/ This will require quite a lot of work to make it bullet-proof. Any volunteers? PR are welcome.

Источник

Fingerprint has already been taken gitlab

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.

Please enter /home/ /.ssh/id_rsa2

Make sure to cut away everything at the end of the base64 encoded string. Also remove all newlines so the string contains no newlines.

This did the trick for me.

In my case; the public key i was trying to add was already used with ‘work’ Gitlab account and i received the said error upon trying to use the same key with ‘personal’ Gitlab account.

Solution — Add another public key on the same machine and use that with ‘personal’ gitlab account (both on same machine).

navigate to .ssh folder in your profile (even works on windows) and run command

when asked for file name give another filename id_rsa_2 (or any other). enter for no passphrase (or otherwise). You will end up making id_rsa_2 and id_rsa_2.pub

use the command

copy and save key in ‘personal’ Gitlab account.

create a file with no extension in .ssh folder named ‘config’

put this block of configuration in your config file

now whenever you want to use ‘personal’ gitlab account simply change alias in git URLs for action to remote servers.

for example instead of using

git clone [email protected]gitlab.com.

git clone [email protected]gitlab_2.

Источник

 ISSUE:-

While cloning the repository from the Gitlab the following error occurs

Error:-

The form contains the following error:
Fingerprint sha256 has already been taken

Cause:-

The issue was occuring because i have already added the key of my laptop to the company’s gitlab account. And than when i created my own personal gitlab account and tried to clone the repository it complains that the key is already been taken

Solution:-

1. Create a new RSA key file as

ssh-keygen -t rsa

2. Enter the key file as id_rsa2

Generating public/private rsa key pair.
Enter file in which to save the key (/Users/ankit.mittal/.ssh/id_rsa): /Users/ankit.mittal/.ssh/id_rsa2
Enter passphrase (empty for no passphrase): 
Enter same passphrase again: 
Your identification has been saved in /Users/ankit.mittal/.ssh/id_rsa2
Your public key has been saved in /Users/ankit.mittal/.ssh/id_rsa2.pub

3. Add the public key i.e. id_rsa2 to the personal gitlab account

4. Add the config file to the .ssh folder in your user home directory as

(base) C02Z52TZLVCG:~ ankit.mittal$ cd .ssh/
(base) C02Z52TZLVCG:.ssh ankit.mittal$ vim config
(base) C02Z52TZLVCG:.ssh ankit.mittal$ cat config 

Host           gitlab.com
HostName       gitlab.com
IdentityFile   ~/.ssh/id_rsa
User           ankit.mittal


Host           gitlab_2
HostName       gitlab.com
IdentityFile   ~/.ssh/id_rsa2
User           ankit.mittal

5. Run the bash command to make sure the new shell reads the updated config file as

bash

6. For your personal gitlab account just replace gitlab.com with gitlab_2 as

bash-3.2$ git clone [email protected]_2:unixcloudfusion/first-project.git
Cloning into 'first-project'...
remote: Enumerating objects: 6, done.
remote: Counting objects: 100% (6/6), done.
remote: Compressing objects: 100% (5/5), done.
remote: Total 6 (delta 0), reused 0 (delta 0), pack-reused 0
Receiving objects: 100% (6/6), done.

7. If you check the remote now it will show you gitlab_2 which will automatically be aliased to hostname gitlab.com behind the scenes by the config file so you can continue working the same way without releasing any changes apart from converting gitlab.com origin to gitlab_2

Here’s the situation:

  1. The easiest and most secure way to interact with Git repos hosted on GitLab is over the SSH protocol.
  2. While most people only use one GitLab.com account, a freelancer or consultant might need to work with repos from multiple accounts.

If that freelancer attempts to upload their public SSH key to multiple accounts, they’ll get the following error message from GitLab:

Fingerprint has already been taken.

Assuming they don’t want to use password-based authentication over HTTPS as a workaround, how can our friendly freelancer get SSH working?

Table of Contents

The solution is to use a different SSH key pair with each GitLab.com account. How do you do it?

  1. Generate a new SSH key pair. (Detailed instructions
    ).
  2. Add the SSH key to your GitLab account. (Detailed instructions
    ).

How will SSH know which key to use for a given repo? Since Git 2.10, you can use Git’s core.sshCommand option to configure how Git invokes the ssh command. As with all Git options, you can set it globally, or per repository. Let’s set it to point SSH at the key we just created.

  1. Open a terminal and make sure you’re in the repository that needs configuring.
  2. Run git config core.sshCommand "ssh -i ~/.ssh/id_MY_KEY_NAME_HERE -F /dev/null"

The -i tells ssh which “identity” file to use for this command.

Now try running git pull. You should be prompted for the private key’s password and the pull should finish successfully. You did it!

Configuring SSH agent to use the new key

If you weren’t prompted for the password and the git pull operation failed, you’re probably using an SSH agent. The agent likely tried to use your default SSH key and it didn’t fit the lock. That default identity is usually “id_rsa”.

Fortunately, the solution is simple: Tell SSH Agent about your new key using ssh-add. For example, if your new key is called id_yellowbanana and it’s stored in ~/.ssh, the command would like like this:

Bash:

ssh-add ~/.ssh/id_yellowbanana

PowerShell:

If you’re on Windows and it doesn’t know where ~ is, try this instead from PowerShell:

ssh-add $env:UserProfile/.ssh/id_yellowbanana

Next, list the keys your agent is managing with ssh-add -l and see if the new key is listed. It should be there.

Try running git pull again. If your agent is configured property, you should be in business.😎

Chicken and egg scenario: git clone

If you’re cloning a real live chicken, you don’t have a chicken and egg scenario. If you’re cloning a GitLab repo over SSH and you want to use an alternate identity, you do.

Jokes aside, what if you haven’t even cloned the repo yet? How do you tell Git which SSH identity to use?

You can temporarily set the GIT_SSH_COMMAND environment variable.

Bash:

GIT_SSH_COMMAND='ssh -i ~/.ssh/id_yellowbanana'
git clone [email protected]:myuser/somerepo.git

PowerShell:

$env:GIT_SSH_COMMAND='ssh -i ~/.ssh/id_yellowbanana'
git clone [email protected]:myuser/somerepo.git

Then configure core.sshCommand on the repo like we did earlier.

That was easy! Now you still have the convenience and security of SSH, and you’ve got it across all your GitLab accounts.

Понравилась статья? Поделить с друзьями:
  • The forest ошибки новичков
  • The forest ошибка при запуске приложения 0xc000007b
  • The forest ошибка oops the game crashed
  • The forest как исправить вылеты
  • The forest как изменить яркость