使用Git生成SSH密钥时出错:“没有这样的文件” [英] Error when generating an SSH key with Git: "no such file"

查看:1685
本文介绍了使用Git生成SSH密钥时出错:“没有这样的文件”的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

 生成公钥/私钥rsa密钥对。 
输入保存密钥的文件(/home/konrad/.ssh/id_rsa):



 无法创建目录'/home/konrad/.ssh'

然后我输入我的口令。

 打开/home/konrad/.ssh/id_rsa失败:没有这样的文件或目录。 
保存密钥失败:/home/konrad/.ssh/id_rsa。

我试过多次重新安装Git,但这并没有帮助。我认为这可能是因为C:/ Users / Konrad应该是默认目录,而不是/ home。任何建议?

解决方案

在msysgit中,您需要首先设置用户环境变量 HOME (这在Windows中并未默认设置)。



HOME 可以设置为任意值你只需要确保你有权写入它(并且该目录存在,并且它下面还有一个 .ssh )。

I continually run into the same error when I try to generate an SSH key:

Generating public/private rsa key pair.
Enter file in which to save the key (/home/konrad/.ssh/id_rsa):

Here I press enter.

Could not create directory '/home/konrad/.ssh'

Then I enter my passphrases.

open /home/konrad/.ssh/id_rsa failed: No such file or directory.
Saving the key failed: /home/konrad/.ssh/id_rsa.

I've tried re-installing Git multiple times, but that hasn't helped. I think it may be because C:/Users/Konrad should be the default directory, rather than /home. Any advice?

解决方案

On msysgit, you need first to set the user environment variable HOME (which isn't set by default in Windows).

HOME can be set to any directory you want, you only have to make sure you have the right to write in it (and that the directory exists and a .ssh under it exists too).

这篇关于使用Git生成SSH密钥时出错:“没有这样的文件”的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆