Wednesday, August 20, 2014

Git, configuring SSH on Windows

a great feature of git ssh is that, when it fails, you are left with very vague error messages that can point to 1000s of different causes. It could hardly stink more. Really only for the expert.


git and ssh, two skunks



c:\pierre>git clone ssh://git@stash.acme.com:7999/pup/puppet-pippov2.git
Cloning into 'puppet-pippov2'...
Could not create directory '/c/WINDOWS/system32/config/systemprofile/.ssh'.
The authenticity of host '[stash.acme.com]:7999 ([10.56.8.198]:7999)' can't be established.
RSA key fingerprint is fb:09:c7:a7:79:07:99:35:3a:88:51:18:59:a6:8e:75.
Are you sure you want to continue connecting (yes/no)? yes
Failed to add the host to the list of known hosts (/c/WINDOWS/system32/config/systemprofile/.ssh/known_hosts).
Permission denied (publickey).
fatal: Could not read from remote repository.

Please make sure you have the correct access rights
and the repository exists.


I really have no clue where this systemprofile is coming from... must be some Windows default...

c:\pierre>echo %userprofile%
C:\Users\Pierluigi

c:\pierre>echo %HOME%
C:\WINDOWS\system32\config\systemprofile


Aha, see: the %HOME% variable is set to something WRONG.
I tried EXPLICITLY setting the %HOME% variable as a SYSTEM environment property (not a USER.... it didn't work....):
c:\pierre\vagrant>echo %HOME%
C:\Users\Pierluigi\

Now it all works. It can create the known_hosts file.
Windows stinks.

1 comment:

Unknown said...

Thanks a lot dude !!! It helped me to make working SCP via jenkins