git - Server host key not cached

the server's host key is not cached in the registry putty
the server's host key does not match the one putty has cached in the registry
the server's host key was not found in the cache
github store key in cache
server's host key did not match the signature supplied tortoisegit
plink auto accept host key
putty server's host key is invalid
the fingerprint of this host is not registered by putty

I try to push changes from my local repo to a remote repo. When I type:

git push origin

I get the following error:

The server's host key is not cached in the registry. You
have no guarantee that the server is the computer you
think it is.
The server's rsa2 key fingerprint is:
ssh-rsa 2048 xx:xx:xx:xx:xx:xx:xx:xx:xx:xx:xx:xx:xx:xx:xx:xx
Connection abandoned.
fatal: The remote end hung up unexpectedly

How can I solve this? I'm using git from the command line in Windows 7.

Edit

When I try to do a simple ssh

ssh user@hostname

I get the following error:

Could not create directory '/c//%HOMEDRIVE%%HOMEPATH%/.ssh'.
percent_expand: unknown key %H

Somehow it will not create the directory, because the path is invalid. How to fix this?

@eckes: Edit2

My Home is set to %HOMEDRIVE%%HOMEPATH% is this correct?

The message means that the host key of origin is not present in your trusted hosts file.

To get around this, open a plain SSH connection to origin and SSH will ask you if you want to trust the remote host (from the Git console):

$ ssh 127.0.0.1
The authenticity of host '127.0.0.1 (127.0.0.1)' can't be established.
RSA key fingerprint is <FINGERPRINT>.
Are you sure you want to continue connecting (yes/no)?

If you trust the remote host (i.e. type yes), SSH will add its key to the list of known hosts.

After that, you should be able to do your git push origin.

As an alternative, you could also manually add the key of origin to .ssh/known_hosts but this requires that you adhere to the format of the known_hosts file as described in the man page of sshd (Section AUTHORIZED_KEYS FILE FORMAT).

Trust A Server's Host Key when No Button is Available to Trust It , The server's host key is not cached in the registry The workaround is simple: just get SourceTree to use Embedded Git and get it to trust the host: And then  git pull origin hubert I get the following error: The server's host key is not cached in the registry. You have no guarantee that the server is the computer you think it is. The server's rsa2 key fingerprint is: ssh-rsa 2048 xx:xx:xx:xx:xx:xx:xx:xx:xx:xx:xx:xx:xx:xx:xx:xx Connection abandoned. fatal: Could not read from remote repository.

Solved: The server's host key is not cached in the registr, git pull origin master The server's host key is not cached in the registry. You have no guarantee that the server is the computer you think it is. The server's host key is not cached in the registry. You have no guarantee that the server is the computer you think it is. The server's rsa2 key fingerprint is: <finger print> Connection abandoned. fatal: Could not read from remote repository. Please make sure you have the correct access rights and the repository exists.

Try doing a "set | grep -i ssh" from the Git Bash prompt

If your setup is like mine you probably have these set:

GIT_SSH='C:\Program Files (x86)\PuTTY\plink.exe'
PLINK_PROTOCOL=ssh
SVN_SSH='"C:\\Program Files (x86)\\PuTTY\\plink.exe"'

I did a

unset GIT_SSH
unset PLINK_PROTOCOL
unset GIT_SVN

and it worked after that,.. I guess putty saves its keys somewhere else as $HOME/.ssh or something... (I've also had a problem on a box where $HOME was set to "C:\Users\usrnam" instead of "/C/Users/usrnam/"

anyway, your mileage may vary, but that fixed it for me. :-)

(probably just doing the unset GIT_SSH is enough, but I was on a roll)

Note: if unset doesn't work for you, try this:

set GIT_SSH=

Stalled at accepting the host key of the server · Issue #503 , When I type: git push origin. I get the following error: The server's host key is not cached in the registry. You have no guarantee that the server is  Windows: Git-bash: The server's host key is not cached in the registry. - gist:274a19ac31b7436fe836

I suspect that your GIT_SSH environment variable is set to %ProgramFiles(x86)%\putty\plink.exe. For some reason, PLink does not use the .ssh/known_hosts file in your user directory to store the remote hosts keys.

If this is actually your case, and it might be so on purpose if you want to use pageant, you need to use PLink to connect to the host first.

"$GIT_SSH" user@hostname

You should get a similar message

The server's host key is not cached in the registry. You
have no guarantee that the server is the computer you
think it is.
The server's rsa2 key fingerprint is:
ssh-rsa 2048 86:7b:1b:12:85:35:8a:b7:98:b6:d2:97:5e:96:58:1d
If you trust this host, enter "y" to add the key to
PuTTY's cache and carry on connecting.
If you want to carry on connecting just once, without
adding the key to the cache, enter "n".
If you do not trust this host, press Return to abandon the
connection.
Store key in cache? (y/n)

Once you have answered y to the question and successfully connected to the remote host, you should be all set. Go ahead and try your push again.

Getting started with PuTTY, In the first part, you are connecting to matthewh.me , and in the second one you are connectiong to www.matthewh.met . The first connection  The server's host key is not cached in the registry. You have no guarantee that the server is the computer you think it is. The server's rsa2 key fingerprint is: ssh-rsa 2048 31:06:3b:0d:cd:23:1a:41:dc:f2:c5:7d:9c:24:07:e6 Connection abandoned. fatal: Could not read from remote repository.

Just ssh'ing to the host is not enough, on Windows at least. That adds the host key to ssh/known_hosts but the error still persists.

You need to close the git bash window and open a new one. Then the registry cache is cleared and the push/pull then works.

git - Server host key not cached, I created new project on gitlab, made all instructions, but when i push: $ git push -​u origin master. The server's host key is not cached in the  The server's host key is not cached in the registry. I'm trying to fetch the commits list from the server via the GUI. After the click on a Fetch button, I get the "Fetching All" progress bar, which seems to work, but not too efficient.

Git Extensions using Putty: The Servers Host Key is Not Cached in , In the real world, most administrators do not provide the host key import a PuTTY stored session to WinSCP, including the cached host keys. You may follow the steps below: Press the _Start_ button Search and execute the _Command Prompt_ Run the command: "C:\Program Files (x86)\Atlassian\SourceTree\tools\putty\plink.exe" bitbucket.org Enter y to accept the server key

Help! Can't push (#162) · Issues · GitLab.com / GitLab.com Support , 컴퓨터를 Window 10 으로 업그레이드 한 후 다시 git 설정 한 다음 Push 를 하려고하니까 다음과 같은 에러가 뜬다 The server's host key is not cached in the registry. git -c diff.mnemonicprefix=false -c core.quotepath=false fetch origin The server's host key is not cached in the registry. You have no guarantee that the server is the computer you think it is. The server's rsa2 key fingerprint is: ssh-rsa 2048 xx:xx:xx:xx:xx:xx:xx:xx:xx:xx:xx:xx:xx:xx:xx:xx If you trust this host, enter "y" to add the key to PuTTY's cache and carry on connecting.

Where do I get SSH host key fingerprint to authorize the server , Git Make. git -c diff.mnemonicprefix=false -c core.quotepath=false push -v --tags --set-upstream origin develop:develop master:master Pushing to git clone git@bitbucket.org:dev/method.git The server's host key is not cached in the registry.

Comments
  • Seems like $HOME isn't set up correctly. Try to set the HOME environment variable on windows using My Computer -> right click -> Properties -> Tab Advanced -> Button Environment Variables
  • I'm not a windows guy, but it does strike me as odd that after /c// (presumably a drive letter) you still have %HOMEDRIVE%... You might be able to save yourself some time by fiddling with the value yourself, and echoing it?
  • Expand HOMEDRIVE and HOMEPATH and set HOME to the resulting value...
  • I got the same message when doing a push to github but I can ssh to github and I do have github.com in my known_hosts file.
  • Look to answer below in this case
  • You can use PuTTY on windows for the same purposes, in place of a command line SSH client.
  • Make sure that the hostnames are exactly the same. For instance if you have git installed locally and use the name 'home.mydomain.com' as your remote, but store the key using putty to connect to 'localhost', that won't work. You need to connect to exactly the host name in your remote url.
  • For me fixed trying to connect with putty to server. Lets say git url is ssh://git@example.ex.com:222/something/shop.git so I entered to putty Host name field example.ex.com and port 222. Then connection failed but I guess it added finger print where it needed. I just do not understand where it added because in my home directory known_hosts - file was not affected when I had deleted old key
  • This should be the accepted answer. It's precisely what the error message is referring to. In my case when I cloned I had used a FQDN, but on my new machine I had only logged in using the short local domain name. I had to login via putty or plink as the FQDN to cache the key for the host name on the origin. It can help to cross check the hostname being used as the remote using "git remote -v".
  • It also works to use interactive PuTTY to the host you're trying to use. For instance, if you are trying to clone a Github repository for the first time on a fresh Windows machine, use PuTTY to open a session to the host 'github.com', accept the prompt regarding server trust, and then a clone at the command line should work.
  • You can tell MSYS git is attemtping to use plink by running $ set | grep GIT_SSH and checking for GIT_SSH='C:\Program Files (x86)\PuTTY\plink.exe'