git clone Host key verification failed

场景

git clone github 项目的时候报错:

Host key verification failed

手动下载后, 提示信息:

Are you sure you want to continue connecting

git clone Host key verification failed

此时手动输入yes即可. 但是, 我碰到时, 是需要通过脚本自动下载项目的, 不能输入 yes.

解决

执行命令, 提前将github添加到信任的主机列表中即可.

ssh-keyscan -t rsa github.com >> /root/.ssh/known_hosts

上一篇:SpringBoot 启动失败 Failed to determine a suitable driver class 问题解决方案


下一篇:mysql执行脚本文件时总是显示failed to open file