Cant find “known_hosts” file

Posted on

Cant find “known_hosts” file – Managing your servers can streamline the performance of your team by allowing them to complete complex tasks faster. Plus, it can enable them to detect problems early on before they get out of hand and compromise your business. As a result, the risk of experiencing operational setbacks is drastically lower.

But the only way to make the most of your server management is to perform it correctly. And to help you do so, this article will share nine tips on improving your server management and fix some problem about windows, windows-server-2008, ssh, known-hosts, .

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:

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

Solution :

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.

Leave a Reply

Your email address will not be published.