Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Git clone: Could not create Directory

I am trying to clone a repository, but I am getting an error

Could not create directory '/c/Windows/system32/config/systemprofile/.ssh'.
The authenticity of host '(host here)' can't be established.

I am running Windows 7 and using tortoiseGit. I have generated a ssh key and added it to server. Any suggestions what am I doing wrong?

like image 872
Kapaacius Avatar asked Jul 01 '13 09:07

Kapaacius


2 Answers

Just add HOME variable with C:\Users\username value under User Variables

Click here to see sample image

like image 133
gowtk Avatar answered Oct 27 '22 06:10

gowtk


Just ran into this issue and wanted to post the solution.

When using a CYGWIN version of SSH you need to create an environment variable called HOME. If you create HOME as a System variable and set it to %USERPROFILE%, and cmd/bash gets launched as system (elevated), your %HOME% path will be C:\Windows\System32.

An easy fix is to hardcode your userprofile path C:\Users\username to the HOME system variable, however if you have multiple users you will need to create environment variables accordingly.

I was not implicitly launching cmd as SYSTEM however I was having this problem and not sure why. Safest option would be to only have a user environment variable called %USERPROFILE% and to not use an elevated command prompt.

If you're having this issue then run ECHO %HOME% and you'll see what the variable is being read as (or if it exists).

like image 40
Jens Bodal Avatar answered Oct 27 '22 04:10

Jens Bodal