4

I normally use Linux and everything goes very well. :-) But I have a machine which runs with Windows 7. :-\

When I try to connect to a server using Git Bash I receive following message:

The authenticity of host '144.76.35.106 (144.76.35.106)' can't be established.
ECDSA key fingerprint is 50:50:10:f7:40:50:b8:3a:20:c5:20:20:00:a0:d8:70.
Are you sure you want to continue connecting (yes/no)?

Normally I should only type yes and hit enter. But we are talking about Windows... ;-)

The problem is that in this special case the folder ~/.ssh is not writeable and I'm unable to change rights. (Why is that so is related to the security philosophy of the company. Unfortunately I have no influence here).

So I would like to know if there's any chance to change this: So when I type yes and hit enter the file known_hosts is saved in another place and most important, that the file is read next time when I access the server once again.

In other words: Where can I configure that Git look for known_hosts in another place than ~/.ssh using Windows?

Many thanks in advance!!!

Aloysia de Argenteuil
  • 833
  • 2
  • 11
  • 27

1 Answers1

4

The problem is that in this special case the folder ~/.ssh is not writeable and I'm unable to change rights.

Here is simply the value referenced by the environment variable HOME.
Check its value with echo $HOME in your bash session.

HOME should be set by default to %USERPROFILE%, but you can set it to any other folder of your choice, where you know you have the right to write.

VonC
  • 1,262,500
  • 529
  • 4,410
  • 5,250
  • 2
    thanks for your answer. Could you please tell me how I could set it to any other folder of my choice in Windows? – Aloysia de Argenteuil Oct 24 '15 at 20:23
  • Simply by setting the environment variable HOME to the folder of your choice (http://superuser.com/a/25105/141, http://www.digitalcitizen.life/create-user-system-environment-variables-windows-7-windows-8). Then calling git-bash.exe or git-cmd.exe of the latest git-for-windows as I mentioned in my other answer: http://stackoverflow.com/a/33314916/6309 – VonC Oct 24 '15 at 20:28
  • 2
    I have tried to use `setx HOME "%USERPROFILE%"` and it responds with `SUCCESS: Specified value was saved.` however it doesn't change because `echo %HOME%` *still* shows `H:\\` – Someone Somewhere Mar 17 '17 at 15:34
  • 1
    I checked my Windows Environemtn Variables, and I see that within my user variables, HOME is correctly set. It's wrong in `git bash` and `git cmd` however I can't change it... :( any help would be appreciated – Someone Somewhere Mar 17 '17 at 15:38
  • @SomeoneSomewhere Did you open a new CMD session? Only a new session would inherit the changes made to the Windows environment variables. – VonC Mar 17 '17 at 15:45
  • Hi VonC, yes every new Bash or Cmd window I open, the home is incorrectly set to /h/ :-( – Someone Somewhere Mar 20 '17 at 15:29