【Git】The authenticity of host '192.168.1.1 (192.168.1.1)' can't be established.

背景,在服务器用www用户身份 执行拉取命令报错

sudo -u www git pull

原因分析:

在新生成密钥之后,在.ssh文件夹中少了known_hosts文件

解决办法:

Are you sure you want to continue connecting (yes/no)? yes

这里填yes就好了。
此时选择yes回车之后便生成了缺少了的known_hosts文件

再次执行上边的命令。就ok了

完整过程如下图

原文地址:https://www.cnblogs.com/richerdyoung/p/11913978.html