SSH Clone asks password

I’ve installed a brand new Gitea server with a seperate gitea user running the gitea service.

After adding the SSH keys in gitea I’m not able to clone via SSH. using
ssh -T gitea@myhost responds with a request for a gitea user password.

What I’ve tried so far:

  • Verify authorized_keys - No authorized_keys config is generated by Gitea.
  • Verify authorized_keys file exists for the gitea user with .ssh 700 & 600 for the authorized_keys file.
  • SSH works for root user.
  • Re-add SSH keys to Gitea after verifying the authorized_keys exists for gitea user.
  • Try to force this config to be created from Administration menu
  • Try USE_COMPAT_SSH_URI = true in the config file.
  • I’m able to clone and push with https but this is not ideal for deployment scenarios.

How do I get Gitea to add my SSH key uploaded in the user profile to authorized_keys? I think this is at the heart of the issues I’m seeing.

Have you followed these steps?

I had missed the part where I had to add the public key via the UI page and was trying to add content to the authorized_keys directly.
I ended up using 2 keys.
1 for the gitea command to ssh from host/server to container.
1 for the client to ssh into host/server
Both keys need to be setup for the git user (or looks like gitea user for you)

I also had to ensure I had created the git user which I saw in this thread

The final thing for me since I was using 2 keys was to ensure I use ssh config file. I’m sure you would be able to do all this using a single key but when I used my approach I at least was able to get rid of the password issue.

1 Like