主机的真实性无法建立 [英] The authenticity of host can't be established

查看:246
本文介绍了主机的真实性无法建立的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我第一次进行git pull,并且在git中提示主机的真实性无法建立,与我生成的私钥相比,RSA密钥指纹不正确。我只是想知道如何更新它,以便它读取正确的文件,为什么它首先读错了指纹?

解决方案

我有类似的问题,这意味着远程主机是未知/不可信的。解决方法是在known_hosts文件中有远程主机条目。



这就是我所做的:


  1. 生成(或使用现有的)RSA密钥并将它们存储在< USER.HOME> /。ssh 文件中。如果你使用eclipse,你可以使用Preferences来生成RSA密钥;


    • 常规 - >网络连接 - > SSH2,然后选择密钥管理。

    • 现在点击生成RSA密钥...

    • 然后保存私钥... 放入.ssh文件夹


  2. 现在您的< USER.HOME> /。ssh 将包含文件;私钥,公共密钥和known_hosts


  3. 与您的可信主机共享您的公钥。 打开Git Bash Promp(命令提示符)并输入下面的命令。

    • ssh -vt< user> @< hostname>
    • 例如:ssh -vt git@mygithub.com

  4. 当它提示错误时...是否确定要继续连接(是/否)?
  5. 说'是'

  6. 现在您的远程主机已添加到known_hosts

  7. 完成。

现在,如果您尝试将文件推送到远程,您看不到任何错误。


I am doing a git pull for the first time and have been prompted in git that the authenticity of host can't be established, the RSA key fingerprint isn't correct compared to the private key I generated. I was just wondering how I can update this so it reads the correct file and why does it read the wrong fingerprint in the first place?

解决方案

I had similar issue, which means that the remote host is unknown /untrusted. The fix is to have the remote host entry in the known_hosts file.

This is what I have done:

  1. Generate (or use existing) RSA keys and store them in the <USER.HOME>/.ssh file. If you are using eclipse, you can generate RSA keys using Preferences;

    • General -> Network Connections -> SSH2 and then select the Key Management.
    • Now Click Generate RSA Key...
    • And then Save Private Key... in the .ssh folder
  2. Now your <USER.HOME>/.ssh would contain file; private key, public key and known_hosts

  3. share your public key with your trusted hosts.
  4. Open Git Bash Promp (command prompt) and enter below command.
    • ssh -vt <user>@<hostname>
    • For Example: ssh -vt git@mygithub.com
  5. When it prompts error ... Are you sure you want to continue connecting (yes/no)?
  6. Say 'yes'
  7. Now your remote host is added to the known_hosts
  8. Done.

Now if you try pushing the file to remote, you don't see any errors.

这篇关于主机的真实性无法建立的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆