Error 500 when add ssh keys on Windows platform. #2264

Closed
opened 2025-11-02 04:30:19 -06:00 by GiteaMirror · 2 comments
Owner

Originally created by @kempliu on GitHub (Aug 28, 2018).

  • Gitea version (or commit ref):179123d
  • Git version:git version 2.16.2.windows.1
  • Operating system: Windows Server 2016/10
  • Database (use [x]):
    • PostgreSQL
    • MySQL
    • MSSQL
    • SQLite
  • Can you reproduce the bug at https://try.gitea.io:
    • Yes (provide example URL)
    • No
    • Not relevant
  • Log gist:
    2018/08/29 07:20:26 [...user/setting/keys.go:96 KeysPost()] [E] AddPublicKey: 'ssh-keygen -lf C:\Users\ELITEB~1\AppData\Local\Temp\gitea_keytest516028331' failed with error 'exec: "ssh-keygen": executable file not found in %PATH%':

Description

I can run ssh-key in Command Line Model and Git Bash. Also copied ssh-keygen.exe to the same path of gitea.exe without luck.
...

Screenshots

Originally created by @kempliu on GitHub (Aug 28, 2018). <!-- 1. Please speak English, this is the language all of us can speak and write. 2. Please ask questions or configuration/deploy problems on our Discord server (https://discord.gg/NsatcWJ) or forum (https://discourse.gitea.io). 3. Please take a moment to check that your issue doesn't already exist. 4. Please give all relevant information below for bug reports, because incomplete details will be handled as an invalid report. --> - Gitea version (or commit ref):179123d - Git version:git version 2.16.2.windows.1 - Operating system: Windows Server 2016/10 - Database (use `[x]`): - [ ] PostgreSQL - [ ] MySQL - [ ] MSSQL - [x] SQLite - Can you reproduce the bug at https://try.gitea.io: - [ ] Yes (provide example URL) - [x] No - [ ] Not relevant - Log gist: 2018/08/29 07:20:26 [...user/setting/keys.go:96 KeysPost()] [E] AddPublicKey: 'ssh-keygen -lf C:\Users\ELITEB~1\AppData\Local\Temp\gitea_keytest516028331' failed with error 'exec: "ssh-keygen": executable file not found in %PATH%': ## Description I can run ssh-key in Command Line Model and Git Bash. Also copied ssh-keygen.exe to the same path of gitea.exe without luck. ... ## Screenshots <!-- **If this issue involves the Web Interface, please include a screenshot** -->
GiteaMirror added the type/question label 2025-11-02 04:30:19 -06:00
Author
Owner

@leepfrog-ger commented on GitHub (Aug 29, 2018):

You need to add the folder where ssh-keygen is located to the PATH environment variables. Default would be C:\Program Files\Git\usr\bin\.

Then restart the whole system to make sure the contents of PATH are not still in cache (or close all command prompts/processes and start gitea again).

@leepfrog-ger commented on GitHub (Aug 29, 2018): You need to add the folder where ssh-keygen is located to the PATH environment variables. Default would be `C:\Program Files\Git\usr\bin\`. Then restart the whole system to make sure the contents of PATH are not still in cache (or close all command prompts/processes and start gitea again).
Author
Owner

@lafriks commented on GitHub (Aug 29, 2018):

closing as answered

@lafriks commented on GitHub (Aug 29, 2018): closing as answered
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: github-starred/gitea#2264