Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Cannot access gitlab repo using ssh keys using Windows

Tags:

git

ssh

gitlab

I have followed these instructions for generating keypairs using ssh-keygen. I actually generated both the ed25519 and an rsa key as I attempted to figure out what was wrong.

I copied and pasted the public key pair for both of these keys in gitlab according to their instructions.

when I enter: ssh -T [email protected] it says:

client_global_hostkeys_private_confirm: server gave bad signature for RSA key 0

but it also says Welcome to gitlab, @my_username!

when I try to push to my repo, I get a popup asking for my gitlab username and password which I enter and which fails.

I don't understand why it is prompting me for a username and password considering that I have attempted to establish SSH keypairs for authentication.

Any advice is appreciated

like image 379
unbutu Avatar asked Dec 14 '22 07:12

unbutu


1 Answers

I get a popup asking for my gitlab username and password which I enter and which fails.

Check, as commented:

  • git remote -v
  • git config credential.helper

If the first starts with https://, and the second is not empty, what you see is a Git credential helper trying to cache your HTTPS credentials.
That means your SSH key would be ignored anyway.

Regarding the error message, check out this thread, and test it with:

ssh -o UpdateHostKeys=no -Tv [email protected]

To make it persistent, in ~/.ssh/config:

Host gitlab.com
  UpdateHostKeys no
like image 125
VonC Avatar answered Dec 17 '22 22:12

VonC