Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

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

Tags:

git

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?

like image 519
Konrad Avatar asked Jun 04 '11 16:06

Konrad


1 Answers

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

like image 127
VonC Avatar answered Oct 15 '22 05:10

VonC