0

I'm currently running a git server on my computer and trying to clone a repository using SSH. The clone works if I use the prefix gitea@host.net:repo.git but fails if I use git@host.net:repo.git. The fail seems to be related to the user but I'm not sure about it. It just says :

git@127.0.0.1: Permission denied (publickey).
fatal: Could not read from remote repository.

Please make sure you have the correct access rights
and the repository exists.

I have the following config in ~/.ssh/config:

# Gitea
Host host.net
    HostName 127.0.0.1
    User user
    IdentityFile ~/.ssh/gitea

With the correct private key in ~/.ssh/gitea (I checked the sha256 hash in the web interface). In the web interface the cloning ssh url is gitea@host.net:repo.git

Is there a way to change that URL so that I can use git@host.net:repo.git instead or is it hard baked into gitea?

torek
  • 448,244
  • 59
  • 642
  • 775
vegalock
  • 51
  • 7
  • As far as the ssh part goes, replacing `User user` with `User gitea` will make ssh do what you need for the moment. Making gitea itself do what you want—use `git` rather than `gitea`—is a matter for gitea and/or sshd and/or your OS. – torek Nov 18 '21 at 06:15

0 Answers0