GOGS服务器添加SSH公钥时,发生500错误

查看日志,发现有这么一行:
[…ters/user/setting.go:336 SettingsSSHKeysPost()] [E] AddPublicKey: addKey: ‘ssh-keygen -lf C:/Windows/TEMP/628906200/id_rsa.pub’ failed with error ‘exec: “ssh-keygen”: executable file not found in %PATH%’:

然后就把ssh-keygen.exe文件所在的目录(默认在C:\Program Files\Git\usr\bin)添加到环境变量path中,问题解决。

要注意的是,要添加到系统的环境变量,而不是当前用户的。