Score:0

Gitea offers wrong SSH key

in flag

I'm running Gitea on a virtual machine that is publicly accessible under gitea.myorg.foo. Here's the server part relevant to my SSH configuration of my configuration file:

[server]                                                                                                                       
SSH_DOMAIN       = gitea.myorg.foo                                                                                            
DOMAIN           = gitea.myorg.foo                                                                                            
ROOT_URL         = https://gitea.myorg.foo/                                                                                   
DISABLE_SSH      = false                                                                                                       
SSH_PORT         = 22                                                                                                                                                                                                                                                                                                     
OFFLINE_MODE     = false

This means that I'm running the server's sshd, not Gitea's internal sshd.

The server runs under a user called git. In /home/git/.ssh/authorized_keys, the authorized keys (per user and deployment keys) are listed.

Unfortunately, the deployment key is not offered when I try to clone a repository with that deployment key enabled.

Let's say I'd like to clone [email protected]/org/repo.git, I get offered a key with a totally different signature than what is displayed under "Deploy Keys" in the web UI. When I run ssh-keyscan gitea.myorg.foo, I only get signatures not to be found in /home/git/.ssh/authorized_keys.

How can I figure out and configure what keys SSH is offering to the client?

Edit: I noticed that the key offered is the one marked as HostKey defined in /etc/ssh/sshd_config. Do I need to use Gitea's internal SSH server, or could I configure my native SSH server accordingly?

Score:0
in flag

I mixed up the host key and my deployment key. It's totally OK that the host key is returned. However, I made the mistake to rely on the deployment key in the .knwon_hosts file, where I should use the host key instead.

mangohost

Post an answer

Most people don’t grasp that asking a lot of questions unlocks learning and improves interpersonal bonding. In Alison’s studies, for example, though people could accurately recall how many questions had been asked in their conversations, they didn’t intuit the link between questions and liking. Across four studies, in which participants were engaged in conversations themselves or read transcripts of others’ conversations, people tended not to realize that question asking would influence—or had influenced—the level of amity between the conversationalists.