0

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.

TheCleaner
  • 32,627
  • 26
  • 132
  • 191
Steini
  • 103
  • 1
  • 1
  • 3
  • you have OpenSSH installed on that Windows server? – Danila Ladner Dec 12 '13 at 14:06
  • I have installed and running "bitvise SSH server" and "openSSL" for my SSL certificates, but that didnt help me so far aswell – Steini Dec 12 '13 at 14:09
  • Ok so then you do your git work on that server, then which ssh client do you use for your user? Also bitvise SSH? – Danila Ladner Dec 12 '13 at 14:24
  • 1
    @Danila: I installed Msysgit which has inluded SSH support with no need for an external client. I didn't think about that and searched everywhere but not inside the GIT folder. There is my .ssh folder together with the known_hosts file, however im still puzzled how all the other applications know that they should use this file? Is there a general config or system variable that determins which file to use? However, the question can be considered as solved. – Steini Dec 12 '13 at 14:36
  • @Steini, go ahead and post your conclusion as the answer. It's ok to answer your own question. You can create a new one if necessary for Danila to answer about the "still puzzled" part. – TheCleaner Dec 12 '13 at 14:41
  • I would if I could... "Users with less than 10 reputation can't answer their own question for 8 hours after asking" – Steini Dec 12 '13 at 14:49

1 Answers1

0

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.

Danila Ladner
  • 5,331
  • 22
  • 31