主机的真实性无法建立 [英] The authenticity of host can't be established
问题描述
我第一次进行git pull,并且在git中提示主机的真实性无法建立,与我生成的私钥相比,RSA密钥指纹不正确。我只是想知道如何更新它,以便它读取正确的文件,为什么它首先读错了指纹?
我有类似的问题,这意味着远程主机是未知/不可信的。解决方法是在known_hosts文件中有远程主机条目。
这就是我所做的:
-
生成(或使用现有的)RSA密钥并将它们存储在
< USER.HOME> /。ssh
文件中。如果你使用eclipse,你可以使用Preferences来生成RSA密钥;
- 常规 - >网络连接 - > SSH2,然后选择密钥管理。
- 现在点击
生成RSA密钥...
- 然后
保存私钥...
放入.ssh文件夹
-
现在您的
< USER.HOME> /。ssh
将包含文件;私钥,公共密钥和known_hosts - 与您的可信主机共享您的公钥。 打开Git Bash Promp(命令提示符)并输入下面的命令。
-
ssh -vt< user> @< hostname>
例如:ssh -vt git@mygithub.com
-
- 当它提示错误时...是否确定要继续连接(是/否)?
- 说'是'
- 现在您的远程主机已添加到known_hosts
- 完成。
现在,如果您尝试将文件推送到远程,您看不到任何错误。
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:
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
Now your
<USER.HOME>/.ssh
would contain file; private key, public key and known_hosts- share your public key with your trusted hosts.
- Open Git Bash Promp (command prompt) and enter below command.
ssh -vt <user>@<hostname>
- For Example: ssh -vt git@mygithub.com
- When it prompts error ... Are you sure you want to continue connecting (yes/no)?
- Say 'yes'
- Now your remote host is added to the known_hosts
- Done.
Now if you try pushing the file to remote, you don't see any errors.
这篇关于主机的真实性无法建立的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!