39

I am working on a project with my teammates. Some weeks ago, I pulled the project from git successfully. But today when I wanted to pull the updated project via the command "git pull origin <my_branch>", it gave me the following error:

client_global_hostkeys_private_confirm: server gave bad signature for RSA key 0

I have generated the public key using the command ssh-keygen and then pasted the content of the new generated file id_rsa.pub in the "Add an SSH key" section of Git, But the pull command did not work. Could somebody help me?

Mohsen Arab
  • 435
  • 1
  • 4
  • 5
  • [Not exactly a duplicate, but perhaps close enough](https://stackoverflow.com/a/66876321/1256452) (which leads you to https://www.reddit.com/r/archlinux/comments/lyazre/openssh_update_causes_problems/) – torek May 06 '21 at 01:08

1 Answers1

90

The message "client_global_hostkeys_private_confirm: server gave bad signature for RSA key 0" is not an error, it is a warning, and it is related to some ssh versioning issue. It used to be very common to receive from GitLab.

If you want it to go away, you can make sure that your ~/.ssh/config contains the following:

Host gitlab.com
    UpdateHostKeys no

However, if you are in fact being prevented from pulling, then this bad signature warning is probably not the reason. Once you make the warning go away, you will still have to find the real problem that you have, about which we know nothing, as the question stands right now.

Mike Nakis
  • 56,297
  • 11
  • 110
  • 142
  • 11
    What potential side-effects would this have? Does it risk masking a serious problem in some other context? – J. B. Rainsberger Jul 10 '21 at 10:42
  • 4
    If this is the first time you have created `~/.ssh/config`, make sure you also give it the correct permissions with `chmod 0600 ~/.ssh/config` to prevent the error "Bad owner or permissions on [..]" – GeraldScott Aug 09 '21 at 03:09