gpt4 book ai didi

bash - Git Bash - ssh-keygen 不工作(在生成 RSA key 对之前退出)

转载 作者:行者123 更新时间:2023-12-02 14:17:46 25 4
gpt4 key购买 nike

它可以与 Eclipse 默认的 git 扩展一起正常工作,我可以使用它进行每一个操作,我什至可以生成 RSA key 。

但是当我使用 git bash 访问 git remote 时,我得到了这个错误:

The authenticity of host '[hostname]:PORT ([IP Address]:PORT)' can't be established.
RSA key fingerprint is SHA256:U...M.
Are you sure you want to continue connecting (yes/no)? fatal: Could not read from remote repository.
Please make sure you have the correct access rights and the repository exists.

然后我删除了现有的 RSA key 并尝试生成新的 RSA key 对及其启动,然后在完成前退出。
ssh-keygen
Generating public/private rsa key pair.
Enter file in which to save the key (/c/Users/userName/.ssh/id_rsa):
userName@example MINGW64 ~/git/path (branch name):

而且我还尝试使用 GIT GUI 生成新的 RSA key ,但出现以下错误
error writing "stdout": broken pipe
error writing "stdout": broken pipe
while executing
"puts $::answer"
(procedure "finish" line 9)
invoked from within
"finish"
invoked from within
".b.ok invoke"
("uplevel" body line 1)

提前致谢。

最佳答案

如果您使用的是最新版本的 Git(2.19.2 或更高版本),请确保生成 PEM 私有(private) SSH key ,而不是 OPENSSH key 。
见“Jenkins: what is the correct format for private key in Credentials

采用:

ssh-keygen -m PEM -t rsa -P "" -f afile

然后再试一次你的 git push,从一个简单的 CMD(不需要 bash),使用 simplified PATH :
set PATH=C:\WINDOWS\system32;C:\WINDOWS;C:\WINDOWS\System32\Wbem;C:\WINDOWS\System32\WindowsPowerShell\v1.0\
set GH=C:\path\to\git
set PATH=%GH%\bin;%GH%\usr\bin;%GH%\mingw64\bin;%PATH%

关于bash - Git Bash - ssh-keygen 不工作(在生成 RSA key 对之前退出),我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/54594983/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com