Access via SSH stop working: Permission denied (publickey)

I cannot access gitlab with ssh anymore. Starting today, all action I try to do with git@gitlab.com is giving me Permission denied (publickey).

What I have tryed:

  • clone the same projetc with https → worked
  • anything using https is working
  • remove all my ssh keys and adding an existing from my computer → no effects
  • test with ssh -Tvvv git@gitlab.com gives me same error
  • creating a new sshkey with ssh-keygen -o -t rsa -b 4096 -C "<comment>", added it to gitlab e using it to test with ssh -i ~/.ssh/gitlab -Tvvv git@gitlab.com gives me same error
  • Others users in my company are getting the same issue. We are all members of the groups where the projects are created
  • trying to git with the user owning the projects works fine!

Looking at the log from the -Tvvv the key exchange with gitlab seems OK, but the final result is Permission denied (publickey)

Final part of the -Tvvv:

debug2: key: /home//.ssh/id_rsa (0xXXXXXXXXX), agent
debug2: key: zas@zis.com.br (0xXXXXXXXXX), agent
debug2: key: zas@zis.com.br (0xXXXXXXXXX), agent
debug2: key: /home//.ssh/id_dsa ((nil))
debug2: key: /home//.ssh/id_ecdsa ((nil))
debug2: key: /home//.ssh/id_ed25519 ((nil))
debug3: send packet: type 5
debug3: receive packet: type 7
debug1: SSH2_MSG_EXT_INFO received
debug1: kex_input_ext_info: server-sig-algs=<rsa-sha2-256,rsa-sha2-512,ssh-rsa,ecdsa-sha2-nistp256,ecdsa-sha2-nistp384,ecdsa-sha2-nistp521,sk-ecdsa-sha2-nistp256@openssh.com,ssh-ed25519,sk-ssh-ed25519@openssh.com,ssh-dss>
debug3: receive packet: type 6
debug2: service_accept: ssh-userauth
debug1: SSH2_MSG_SERVICE_ACCEPT received
debug3: send packet: type 50
debug3: receive packet: type 51
debug1: Authentications that can continue: publickey
debug3: start over, passed a different list publickey
debug3: preferred gssapi-keyex,gssapi-with-mic,publickey,keyboard-interactive,password
debug3: authmethod_lookup publickey
debug3: remaining preferred: keyboard-interactive,password
debug3: authmethod_is_enabled publickey
debug1: Next authentication method: publickey
debug1: Offering RSA public key: /home//.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 60
debug1: Server accepts key: pkalg rsa-sha2-512 blen 535
debug2: input_userauth_pk_ok: fp SHA256:blahblahblah
debug3: sign_and_send_pubkey: RSA SHA256:blahblahblah
debug3: send packet: type 50
debug3: receive packet: type 51
debug1: Authentications that can continue: publickey
debug1: Offering RSA public key: zas@zis.com
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
debug1: Offering RSA public key: zas@zis.com
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
debug1: Trying private key: /home//.ssh/id_dsa
debug3: no such identity: /home//.ssh/id_dsa: No such file or directory
debug1: Trying private key: /home//.ssh/id_ecdsa
debug3: no such identity: /home//.ssh/id_ecdsa: No such file or directory
debug1: Trying private key: /home//.ssh/id_ed25519
debug3: no such identity: /home//.ssh/id_ed25519: No such file or directory
debug2: we did not send a packet, disable method
debug1: No more authentication methods to try.
Permission denied (publickey).

I’m facing same issue so I’ve reported it Git repository access over SSH is broken on GitLab.com (#364868) · Issues · GitLab.org / GitLab · GitLab

As a workaround you can use Ed25519 based key, which seems to work fine.

TY! I will keep an eye on it!

@maethorin can you please provide output of ssh -V command ?