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?
The Authenticity Of Host Can't Be Established Are you sure you want to continue connecting (yes/no)? If your answer is 'yes', the SSH client continues login, and stores the host key locally in the file ~/. ssh/known_hosts . If your answer is 'no', the connection will be terminated.
A file associated with a specific account that contains one or more host keys. Each host key is associated with an SSH server address (IP or hostname) so that the server can be authenticated when a connection is initiated.
ssh-keyscan is a command for gathering the public host keys for a number of hosts. It aids in building and verifying ssh_known_hosts files. ssh-keyscan provides a minimal interface suitable for use by shell and Perl scripts.
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;
Generate RSA Key...
Save Private Key...
in the .ssh folderNow your <USER.HOME>/.ssh
would contain file; private key, public key and known_hosts
ssh -vt <user>@<hostname>
Now if you try pushing the file to remote, you don't see any errors.
After you add your ssh key to GitLab, when you try to clone the repository, If you press enter
directly, you will get below error:
Cloning into 'hfe-insure-m'... The authenticity of host 'git.zhonganinfo.com (100.112.23.182)' can't be established. ECDSA key fingerprint is SHA256:IRLOr2bTvVB2rLgYVgyUibE+oLlZ0pUwU9wycc/5zYU. Are you sure you want to continue connecting (yes/no/[fingerprint])? Host key verification failed. fatal: Could not read from remote repository. Please make sure you have the correct access rights and the repository exists.
Make sure you enter yes
when you see the below sentence, DO NOT press enter
directly.
Are you sure you want to continue connecting (yes/no/[fingerprint])? yes
E.g.
Cloning into 'hfe-insure-m'... The authenticity of host 'git.zhonganinfo.com (100.112.23.182)' can't be established. ECDSA key fingerprint is SHA256:IRLOr2bTvVB2rLgYVgyUibE+oLlZ0pUwU9wycc/5zYU. Are you sure you want to continue connecting (yes/no/[fingerprint])? yes Warning: Permanently added 'git.zhonganinfo.com,100.112.23.182' (ECDSA) to the list of known hosts. remote: Enumerating objects: 31607, done. remote: Counting objects: 100% (31607/31607), done. remote: Compressing objects: 100% (10365/10365), done. remote: Total 31607 (delta 20695), reused 31485 (delta 20604) Receiving objects: 100% (31607/31607), 21.51 MiB | 581.00 KiB/s, done. Resolving deltas: 100% (20695/20695), done.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With