开发者

Error when generating an SSH key with Git: "no such file"

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).


Drop to a command line and type:

ssh-keygen -t rsa

And follow the prompts there. I'm pretty sure git's doing exactly that under the hood for you.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜