The authenticity of host can't be established

前端 未结 4 1528
广开言路
广开言路 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 01:42

    There is a better answer posted here:

    http://stackoverflow.com/questions/2643502/git-permission-denied-publickey

    This saved me!!!

    These commands only work in the git bash prompt. For windows you most likely will need to be in your c:/users//.ssh directory. and also name your key "is_rsa". passphrase is optional and if you provide on you'll be prompted for it each time you do a pull.

    good luck.

    0 讨论(0)
  • I have the same issue in Ubuntu. Just Change the permissions and enabling it for ssh-keys

    0 讨论(0)
  • 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 <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.

    0 讨论(0)
  • 2021-02-07 02:07

    Another problem I ran into was multiple entries in the known_hosts file as well as a known_hosts2 file.

    My only guess is that since I reused a host name in ./ssh/config to point to different IPs it got confused an created multiple entries.

    0 讨论(0)
提交回复
热议问题