Use git with ssh on win10

I install Gitea on win10. I create a user ‘git’ and set the ‘RUN_USER’ as ‘git’. And if I set the [server] SSH_ROOT_PATH as git\.ssh\authorized_keys, Gitea will create a empty dir instead of a file.

  1. Should I run gitea as ‘git’? Gitea write public key in user.ssh instead of git.ssh.

  2. When I use OpenSSH Server on win10, I can ssh user@server but when I try to git clone git@server:xxx I get

git@server: Permission denied (publickey,password,keyboard-interactive).
fatal: Could not read from remote repository.

Please make sure you have the correct access rights
and the repository exists.
  1. When I use the build-in ssh server, I can clone but when I try to ssh user@server I get user@server: Permission denied (publickey).

Could anyone help me? Thanks!

In windows, Gitea will not check RUN_USER. So a git user is not necessary. When you use built-in SSH server, how did you clone? could you try ssh -T user@server?

@lunny Thanks for your help! The build-in SSH server works well and now I know that it can’t be used for logging in. If I understand you correctly, because Gitea won’t check RUN_USER on windows, it write the public key in user\.ssh but not git\.ssh. So I can’t use git with OpenSSH with git user.
So is there any way to use ssh and git at same time? I can use OpenSSH and build-in ssh on different port but it’s inconvenient. Is there any better solution? Thanks!