The authenticity of host can't be established

前端 未结 4 1532
广开言路
广开言路 2021-02-07 01:02

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 th

4条回答
  •  走了就别回头了
    2021-02-07 02:02

    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 /.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 /.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 @
      • 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.

提交回复
热议问题