3

While pushing code to master branch in a repo I found this message from sourceTree though I have added public key in my github and generated private key and added in my pageant key list.The message 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:
ssh-rsa 2048 16:27:ac:a5:76:28:2d:36:63:1b:56:4d:eb:df:a6:48

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. 

enter image description here

I did not find any thing to write there. How can I solve it?

Istiak Morsalin
  • 10,621
  • 9
  • 33
  • 65
  • If you want to trust all certificates then just enter `"y"` and carry on. If you want to install the repository's certificate then you will have to a bit more work. What do you want to do? – Tim Biegeleisen May 09 '16 at 05:35
  • I can not enter y there. there was no option to write. – Istiak Morsalin May 09 '16 at 05:39
  • No. It prompted you with clear text, meaning that what you enter does not get echoed to the console (for security reasons--they don't want your clear text password to even be visible temporarily). Just type `"y"` press enter and swallow the pill. – Tim Biegeleisen May 09 '16 at 05:42
  • Issue still appears. And this is done through the UI of source tree - it prints the message, but does not provide input. – Tigris Jun 10 '22 at 13:26
  • Warning March 2023: "[**GitHub has updated its RSA SSH host key**](https://stackoverflow.com/a/47708298/6309)" – VonC Mar 24 '23 at 09:51

2 Answers2

1

Apparently my sourcetree installation uses putty for the ssh connection. By trying to connect to the server in putty I could use input and add the key to the cache. After this the sourcetree push worked.

Tigris
  • 133
  • 8
0

One way to avoid seeing that with SourceTree is to pre-populate the known_hosts file in advance:

ssh-keyscan -H github.com >> $HOME/.ssh/known_hosts
# on Windows, with `<git>/usr/bin` in the `%PATH%`
ssh-keyscan -H github.com >> %USERPROFILE%\.ssh\known_hosts

Warning March 2023:

"GitHub has updated its RSA SSH host key"


VonC
  • 1,262,500
  • 529
  • 4,410
  • 5,250