windowsgit-bashunknown-host

How to change the place where git bash should look for known_hosts in windows


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!!!


Solution

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