Permission Denied with SSH Keys

Hello Gitea friends,

I am facing an issue with SSH access to repos. I am the admin and I was first to create a new key and register it with my user + verify it. We are using the embedded SSH server. Gitea is running in a docker container on Ubuntu.

My SSH key that I created a few months ago works. However, new keys that me or other users create and add to the user profile do not work. I checked and the new keys show in the database with type 1 so they should be available for users to clone, pull, push etc. I tested with my user to create a new key on the client, added it to my user, verified it successfully. But when I then use this key i get permission denied.

These are the verbose SSH logs for the command ssh -T -vvv -p 2222 -i ~/.ssh/test3 git@git.domain.com
debug1: Next authentication method: publickey
debug1: Will attempt key: test3 ED25519 SHA256: explicit
debug2: pubkey_prepare: done
debug1: Offering public key: test3 ED25519 SHA256: explicit
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
debug2: we did not send a packet, disable method
debug1: No more authentication methods to try.
git@git.domain.com: Permission denied (publickey).

Do you have any ideas for help here? Thank you very much

We had a similiar Problem. Do you have a ssh client on your host machine, where your docker runs?

If so disable it.
In our case we wanted to have this ssh client on host and had to remap the ssh-port to the gitea instance on another one. If you want to checkout repositories via ssh in this case you have to add an entry in your .ssh/config with that port. Something like:

Host gitea.your-domain.com
    HostName gitea.your-domain.com    
    Port 12345