SSH Key is not being accepted

I am trying to clone one of my private gitea repos and despite having added my key ssh does not accept my key and moves on to password auth over git.

The key is added to the user that has the repo.
The key has been verified on gitea with a challange on this machine prior to opening this ticket.
the ssh port is open.

debug1: Authentications that can continue: publickey,password
debug1: Next authentication method: publickey
debug1: Will attempt key: /home/dev/.ssh/id_rsa RSA SHA256: [CENSORED]
debug1: Will attempt key: /home/dev/.ssh/id_ecdsa 
debug1: Will attempt key: /home/dev/.ssh/id_ecdsa_sk 
debug1: Will attempt key: /home/dev/.ssh/id_ed25519 
debug1: Will attempt key: /home/dev/.ssh/id_ed25519_sk 
debug1: Will attempt key: /home/dev/.ssh/id_xmss 
debug1: Offering public key: /home/dev/.ssh/id_rsa RSA SHA256: [CENSORED]
debug1: Authentications that can continue: publickey,password
debug1: Trying private key: /home/dev/.ssh/id_ecdsa
debug1: Trying private key: /home/dev/.ssh/id_ecdsa_sk
debug1: Trying private key: /home/dev/.ssh/id_ed25519
debug1: Trying private key: /home/dev/.ssh/id_ed25519_sk
debug1: Trying private key: /home/dev/.ssh/id_xmss
debug1: Next authentication method: password
git@gitea.[CENSORED]'s password: 

This gitea log line stood out to me:

2025/05/28 15:16:37 ...ey/ssh_key_verify.go:38:VerifySSHKey() [E] Unable to validate token signature. Error: crypto/rsa: verification error

Quick thought: is the key that you uploaded listed in the “trying private key” section? I know sometimes if you have too many ssh keys it’ll max out.

I’d maybe recommend setting up an .ssh/config with the following:


Host <gitea-domain>.com
    user gitea
    Port <gitea-port>
    IdentityFile ~/.ssh/<gitea-key-path>
    IdentitiesOnly yes

specifically, the IdentitiesOnly section means it’ll only offer that one key, and you can specify IdentityFile multiple times if you have multiple keys you’d like to use