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

如何验证GitHub仓库专属部署SSH密钥有效性并排查克隆异常?

SSH部署密钥使用问题

已完成操作

  • 生成专属SSH密钥对,私钥保存至~/.ssh/my-repo,公钥保存至~/.ssh/my-repo.pub,且公钥已添加到目标GitHub仓库的部署密钥设置中
  • 配置~/.ssh/config文件,内容如下:
Host *.github.com
  AddKeysToAgent yes
  UseKeychain yes
  IdentityFile ~/.ssh/my-repo

遇到的问题

  • 本地通过SSH克隆仓库时,系统仍提示输入默认SSH密钥~/.ssh/id_ed25519的密码(该默认密钥可正常使用),无法触发专属部署密钥的使用
  • 远程服务器使用该部署密钥克隆仓库时,出现Permission denied (public key)错误

更新信息

执行以下命令时:

ssh -i ~/.ssh/my-repo git clone git@github.com:user/my-repo.git

出现超时错误:

ssh: connect to host git port 22: Operation timed out

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

相关产品推荐
方舟 Agent Plan

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

最近更新时间:2026.08.05 21:05:13