You need to enable JavaScript to run this app.
优惠活动
大模型
产品
解决方案
定价
更多

执行terraform plan遇Host key verification failed错误(GitHub SSO)求助

Terraform执行plan时拉取模块报错Host key verification failed

执行terraform plan时出现如下错误:

╷
│ Error: Failed to download module
│
│ Could not download module "foo" (main.tf:123) source code from
│ "git@github.com:my-company/some-repo": error downloading
│ 'ssh://git@github.com/my-company/some-repo': /usr/bin/git exited with 128:
│ Cloning into '.terraform/modules/foo'
│ Host key verification failed.
│ fatal: Could not read from remote repository.
│
│ Please make sure you have the correct access rights
│ and the repository exists.

已完成的排查操作:

  • 本地SSH密钥已通过ssh-add -l确认加载
  • 直接执行git clone ssh://git@github.com/my-company/some-repo可成功克隆目标仓库
  • 该仓库属于公司GitHub组织,需通过GitHub SSO认证访问
  • 已查阅HashiCorp官方文档中的对应解决方案,完成所有建议操作后问题仍未解决

有没有人知道这个问题的解决办法?

内容的提问来源于stack exchange,提问作者Dommondke

相关产品推荐
方舟 Agent Plan

超全模态模型 × Harness 升级,最新支持 Deepseek-V4.1-Flash、GLM-5.3 系列、Doubao-Seedream-5.0-pro、Kimi-K3 (部分), 限时 9.9 元起

最近更新时间:2026.08.14 17:20:30