Windows – Cant find “known_hosts” file

known-hostssshwindowswindows-server-2008

one short and probably stupid thing is annoying me…

I can't find my 'known_hosts' file on my Windows Server 2008 but it must exist.

On the server I have a git-repository that others can access and this works perfectly.
However my own coding stuff is often done on the server aswell and I simply want to "git push" my contents to the destined repository.

The problem: My Server SSH Fingerprint was changed and I cannot access the repository because it is different in the "known-hosts" file and git denies my push with the good old known warning:

@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@
@    WARNING: REMOTE HOST IDENTIFICATION HAS CHANGED!     @
@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@
IT IS POSSIBLE THAT SOMEONE IS DOING SOMETHING NASTY!
Someone could be eavesdropping on you right now (man-in-the-middle attack)!
It is also possible that the RSA host key has just been changed.
The fingerprint for the RSA key sent by the remote host is
66:d8:(and so on...)
Please contact your system administrator.
Add correct host key in /.ssh/known_hosts to get rid of this message.
Offending key in /.ssh/known_hosts:1
RSA host key for (mydomain.eu) has changed and you have requested strict checking.

I know I simply have to delete the entry in my hosts file to refresh it but here goes the problem as stated in the topic:

This file does not exist in all user accounts
(C:/Users/@USERNAME@/.ssh/known_hosts)
And not only the file does not exist, no user-folder contains an ".ssh" folder and it does not help either to create it in my current user.

But if it doesn't exist, my Git cant know that the key has changed and should ask to add it to the known_host file instead so it has to exist.

Is there any possibility to move the location of this file or to ask git with a command where the file is read from? This seems very odd to me and yes: display hidden and/or system files is enabled I simply cannot find it anywhere on the entire server.

Someone already met this problem and can maybe help me?

Thanks a lot in advance.

Best Answer

OP resolved the problem by discovering that he uses Msysgit which has embedded ssh client and was able locate path for known_hosts entries file.