# Use git with ssh on win10

**URL:** <https://forum.gitea.com/t/use-git-with-ssh-on-win10/1182>\
**Category:** General\
**Created:** [May 26, 2019, 5:22am UTC](https://forum.gitea.com/t/use-git-with-ssh-on-win10/1182 "2019-05-26T05:22:00Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![linsui](https://avatars.discourse-cdn.com/v4/letter/l/6de8d8/32.png) [@linsui](https://forum.gitea.com/u/linsui)\
**Post date:** [May 26, 2019, 5:22am UTC](https://forum.gitea.com/t/use-git-with-ssh-on-win10/1182/1 "2019-05-26T05:22:01Z")

</div>

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

```auto
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!

---

<div class="post-metadata">

**Author:** ![lunny](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.gitea.com/lunny/32/4701_2.png) [@lunny](https://forum.gitea.com/u/lunny)\
**Post date:** [May 26, 2019, 4:06pm UTC](https://forum.gitea.com/t/use-git-with-ssh-on-win10/1182/2 "2019-05-26T16:06:40Z")

</div>

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`?

---

<div class="post-metadata">

**Author:** ![linsui](https://avatars.discourse-cdn.com/v4/letter/l/6de8d8/32.png) [@linsui](https://forum.gitea.com/u/linsui)\
**Post date:** [May 27, 2019, 3:01am UTC](https://forum.gitea.com/t/use-git-with-ssh-on-win10/1182/3 "2019-05-27T03:01:59Z")

</div>

@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!
