Gitea creating wrong ssh key on authorized_keys

Hey y’all… I’m facing an weird error: I finished the setup and everything work fine… I created my user, and an repository, cloned using ssh… but when I try to push my code, ask for gitea password:

$ git push -u origin main
(gitea@192.168.23) Password:

I already added my ssh key on my user… and when I got to the authorized_keys gitea user, I see an command line there, not my user key:

$ cat /home/gitea/.ssh/authorized_keys
# gitea public key
command="/usr/bin/gitea --config=/etc/gitea/app.ini serv key-1",no-port-forwarding,no-X11-forwarding,no-agent-forwarding,no-pty,no-user-rc,restrict ssh-rsa AAAAbbbbbCCCCC=

Appears gitea works fine in the part of including users keys on gitea authorized_keys, but it’s including the command line too…

p.s.: I’m using the default ssh server not the gitea “ssh server”

it’s a bad configuration or an bug?

thanks for all!

Hi @fellipeh, thanks for the report. Just a few questions: What key is being added (is it one you haven’t seen before)? Are you the only user on your instance?

Hey @techknowlogick I found the issue… In the end, when I connect using ssh port 22, I was connecting to the gitea machine ssh, not the “gitea ssh”… I changed the app.ini to start the ssh server, and set port 2222… and using gitea ssh works pretty good!!

The point here I read the docs, and didn’t find this in particular… maybe will be good to have this note on the install process…