Can't get GitLab to accept my SSH key

I recently installed GitLab CE 12.9.0 on CentOS 7 and am having trouble with my keys. I created a RSA keypair on my local box and copied the public key to my profile in GitLab. I verified that the MD5 checksums match, the account name is correct, and i’m using the correct method (SSH not HTTP).

However, when I attempt to push my code I get prompted for a password:
#git push -u origin master
Pushing to git@gitlab.example.com:ansible/roles/apache.git
git@gitlab.example.com’s password:

and here’s some debug from a verbose ssh:
#ssh git@gitlab.example.com -vvv
debug2: we did not send a packet, disable method
debug3: authmethod_lookup publickey
debug3: remaining preferred: keyboard-interactive,password
debug3: authmethod_is_enabled publickey
debug1: Next authentication method: publickey
debug1: Offering public key: RSA SHA256:0Kszf/I94t/VpVl+a6HIJLhge4j/4GgnsGXh+GDzAdo /home/chris/.ssh/id_rsa
debug3: send_pubkey_test
debug3: send packet: type 50
debug2: we sent a publickey packet, wait for reply
debug3: receive packet: type 51
debug1: Authentications that can continue: publickey,gssapi-keyex,gssapi-with-mic,password
debug1: Trying private key: /home/chris/.ssh/id_dsa
debug3: no such identity: /home/chris/.ssh/id_dsa: No such file or directory
debug1: Trying private key: /home/chris/.ssh/id_ecdsa
debug3: no such identity: /home/chris/.ssh/id_ecdsa: No such file or directory
debug1: Trying private key: /home/chris/.ssh/id_ed25519
debug3: no such identity: /home/chris/.ssh/id_ed25519: No such file or directory
debug2: we did not send a packet, disable method
debug3: authmethod_lookup password
debug3: remaining preferred: ,password
debug3: authmethod_is_enabled password
debug1: Next authentication method: pass

Maybe i’ve been staring at this thing for too long but I can’t for the life of me figure out why this isn’t working. Any help would be greatly appreciated

That sounds like https://gitlab.com/gitlab-org/gitlab/-/issues/212178.
A fix should go out in 12.9.1, but until then you can switch to the fast ssh key lookup method (see issue comments).

2 Likes

This command worked for me:
#gitlab-rake gitlab:shell:setup

Thank you so much! This was driving me insane!