The authenticity of host ‘‘ can‘t be established.

git pull(ssh协议)远程分支 报 The authenticity of host ‘xxx’ can’t be established. (window)

错误效果

The authenticity of host 'XXXXX' can't be established.
ECDSA key fingerprint is SHA256:eoLmXa/HGnUXDPFfNQHeqLeyzUbpzVJTvTWluSZfgsiyT8.
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.

排查过程

$ cd ~/.ssh
$ ll
total 9
-rw-r--r-- 1 a9665 197609 1675  3月 25  2019 id_rsa
-rw-r--r-- 1 a9665 197609  401  3月 25  2019 id_rsa.pub
-rw-r--r-- 1 a9665 197609 1280  4月 17 22:57 known_hosts

疑问:通过 进入ssh 目录发现 有三个文件 id_rsa.pub 已经配置到gitlib 里面了,公私钥也是一对但还是报错,网上查了说所以没有 known_hosts 文件,但我的明显有

解决:删掉known_hosts 重新执行 git clone 分支

The authenticity of host 'XXXXX' can't be established.
ECDSA key fingerprint is SHA256:eoLmXa/HGnUXDPFfNQHeqLeyzUbpzVJTvTWluSZfgsiyT8.
Are you sure you want to continue connecting (yes/no/[fingerprint])?

这个地方切记一定要输入 yes,直接按enter键 不然是不能生成known_hosts,正常pull 代码下来的

结果:代码 pull 成功

你可能感兴趣的:(工具,git)