使用Git生成SSH密钥时出错:“没有这样的文件” [英] Error when generating an SSH key with Git: "no such file"
问题描述
生成公钥/私钥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屋!