Cannot clone with built-in SSH server on Windows #8455

Closed
opened 2025-11-02 08:06:41 -06:00 by GiteaMirror · 3 comments
Owner

Originally created by @doggy8088 on GitHub (Feb 1, 2022).

Gitea Version

1.16.0

Git Version

git version 2.35.1.windows.1

Operating System

Microsoft Windows [Version 10.0.19041.1466]

How are you running Gitea?

I'm running from command-line using Windows Service.

Database

PostgreSQL

Can you reproduce the bug on the Gitea demo site?

No

Log Gist

https://gist.github.com/doggy8088/b7cd4708419f77a2988562f995a2cc6c

2022/02/02 00:41:52 modules/ssh/ssh.go:260:sshConnectionFailed() [W] Failed connection from [::1]:50383 with error: [ssh: no auth passed yet]
2022/02/02 00:41:52 modules/ssh/ssh.go:262:sshConnectionFailed() [W] Failed authentication attempt from [::1]:50383

Description

In my client (localhost), I do generate an key-pair. I also setup in Gitea here: https://gitea.localhost/user/settings/keys . I still can't clone using SSH protocol.

PS C:\Projects> git clone git@localhost:will.huang/aaa.git
Cloning into 'aaa'...
git@localhost: Permission denied (publickey).
fatal: Could not read from remote repository.

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

Use HTTPS is fine.

Screenshots

image

image

image

Originally created by @doggy8088 on GitHub (Feb 1, 2022). ### Gitea Version 1.16.0 ### Git Version git version 2.35.1.windows.1 ### Operating System Microsoft Windows [Version 10.0.19041.1466] ### How are you running Gitea? I'm running from command-line using Windows Service. ### Database PostgreSQL ### Can you reproduce the bug on the Gitea demo site? No ### Log Gist https://gist.github.com/doggy8088/b7cd4708419f77a2988562f995a2cc6c ```log 2022/02/02 00:41:52 modules/ssh/ssh.go:260:sshConnectionFailed() [W] Failed connection from [::1]:50383 with error: [ssh: no auth passed yet] 2022/02/02 00:41:52 modules/ssh/ssh.go:262:sshConnectionFailed() [W] Failed authentication attempt from [::1]:50383 ``` ### Description In my client (localhost), I do generate an key-pair. I also setup in Gitea here: https://gitea.localhost/user/settings/keys . I still can't clone using SSH protocol. ```log PS C:\Projects> git clone git@localhost:will.huang/aaa.git Cloning into 'aaa'... git@localhost: Permission denied (publickey). fatal: Could not read from remote repository. Please make sure you have the correct access rights and the repository exists. ``` Use HTTPS is fine. ### Screenshots ![image](https://user-images.githubusercontent.com/88981/152012965-f2326d79-75b7-454c-9714-ff089c286cb3.png) ![image](https://user-images.githubusercontent.com/88981/152013115-a5dc3bc0-d033-4bc3-9048-6e11d5691dfa.png) ![image](https://user-images.githubusercontent.com/88981/152009622-4ef57a99-7a20-41fc-a415-23e2279cbad5.png)
GiteaMirror added the issue/needs-feedbackissue/duplicate labels 2025-11-02 08:06:41 -06:00
Author
Owner

@zeripath commented on GitHub (Feb 1, 2022):

I bet this is a duplicate of #17798

Are you using an RSA key with a very modern version of ssh?

@zeripath commented on GitHub (Feb 1, 2022): I bet this is a duplicate of #17798 Are you using an RSA key with a very modern version of ssh?
Author
Owner

@doggy8088 commented on GitHub (Feb 2, 2022):

@zeripath
Yes, I'm using RSA key. Simply using ssh-keygen to generate a new key-pair locally. I'm using Windows built-in OpenSSH. I'm not sure it's very modern version or not?

C:\>ssh -V
OpenSSH_for_Windows_8.1p1, LibreSSL 3.0.2

I confirmed the workaround works.

Add a new file ~/.ssh/config with the following content:

Host localhost
  HostkeyAlgorithms +ssh-rsa
  PubkeyAcceptedKeyTypes +ssh-rsa
@doggy8088 commented on GitHub (Feb 2, 2022): @zeripath Yes, I'm using RSA key. Simply using `ssh-keygen` to generate a new key-pair locally. I'm using Windows built-in OpenSSH. I'm not sure it's **very modern version** or not? ```sh C:\>ssh -V OpenSSH_for_Windows_8.1p1, LibreSSL 3.0.2 ``` I confirmed the workaround works. Add a new file `~/.ssh/config` with the following content: ```txt Host localhost HostkeyAlgorithms +ssh-rsa PubkeyAcceptedKeyTypes +ssh-rsa ```
Author
Owner

@zeripath commented on GitHub (Feb 2, 2022):

Duplicate #17798

@zeripath commented on GitHub (Feb 2, 2022): Duplicate #17798
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: github-starred/gitea#8455