Warning: file_get_contents(/data/phpspider/zhask/data//catemap/5/bash/17.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Git Bash-ssh密钥根不工作(在生成RSA密钥对之前退出)_Bash_Git_Ssh_Rsa - Fatal编程技术网

Git Bash-ssh密钥根不工作(在生成RSA密钥对之前退出)

Git Bash-ssh密钥根不工作(在生成RSA密钥对之前退出),bash,git,ssh,rsa,Bash,Git,Ssh,Rsa,它在Eclipse默认git扩展中运行良好,我可以使用它执行每个操作,甚至可以生成RSA密钥 但是,当我使用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 connectin

它在Eclipse默认git扩展中运行良好,我可以使用它执行每个操作,甚至可以生成RSA密钥

但是,当我使用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密钥,并尝试生成新的RSA密钥对及其开始,然后在完成之前退出

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):
我还尝试使用GitGUI生成一个新的RSA密钥,我得到了以下错误

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私有SSH密钥,而不是OPENSSH密钥。
见“

使用:

然后使用以下命令从简单的CMD(不需要bash)再次尝试git推送:


我认为这是足够的描述性和编程,它不是一个简单的编码问题,我可以提供足够的重复代码。我在Git上看到了各种问题,ssh也在这个站点上。我不明白为什么会有人投反对票?@OmChoudhary是我下面的答案足以解决你的问题吗?@Sathish太好了!别忘了读书
ssh-keygen -m PEM -t rsa -P "" -f afile
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%