推送远程仓库(github/gitlab) 报错:Host key verification failed. fatal: Could not read from remote repository.

webhook配置完成后,发布时,应用所在的服务器上报 “Host key verification failed. fatal: Could not read from remote repository.”

同步从git上拉取代码失败

做过的一些配置:

  1. 本地仓库的远程仓库地址
  2. ssh密钥对
  3. 在远程仓库上github/gitlab上也已经添加了本地密钥  --互信

解决办法:

方法一:
ssh-keyscan -H github.com >> ~/.ssh/known_hosts

方法二:
ssh -T git@gitlab.com 待确认时输入yes
posted @ 2022-05-22 11:00  MR__Wang  阅读(1819)  评论(0)    收藏  举报