【问题标题】:Implement git clone command in boot2DockerstartGit code meet issue在 boot2DockerstartGit 代码中实现 git clone 命令遇到问题
【发布时间】:2015-08-11 11:40:42
【问题描述】:

当我尝试在 boot2Dockerstart 中实现以下命令时: $ git clone git@github.com:aspnet/Home.git aspnet-Home

我收到以下错误响应: 克隆到“aspnet-Home”... 警告:将 IP 地址“192.30.252.128”的 RSA 主机密钥永久添加到 t 他的已知主机列表。 权限被拒绝(公钥)。 致命:无法从远程存储库中读取。 请确保您拥有正确的访问权限 并且存储库存在。

我该如何解决?

【问题讨论】:

    标签: git boot2docker


    【解决方案1】:

    错误似乎很明显(“权限被拒绝(公钥)。”)。您正在尝试使用 ssh 克隆 git 存储库,这需要 git 有权访问相应的私钥。

    如果这是一个公共存储库,只需将存储库 url 替换为 http:https: url(您可以在 github 上找到)。

    如果是私有仓库,你要么需要让你的私钥对 git 可用,要么你需要设置一个deploy key 来允许访问这个特定的仓库(并提供 that 对应的git 的私钥)。

    【讨论】:

    • Iarsks,谢谢,我用下面的方法可以解决我的问题。
    【解决方案2】:

    ssh-keygen -t rsa -C "forwhat.cn" // "forwaht.cn" 是你在 GitHub 的账号

    然后终端将显示: 生成公钥/私钥 rsa 密钥对。 输入保存密钥的文件(/home/forwhat.cn/.ssh/id_rsa):

    如果您使用默认路径,请按 Enter 键。

    Enter passphrase (empty for no passphrase): //请按 Enter 键。 再次输入相同的密码://请再次按 Enter 按钮。 消息将显示:您的身份已保存在/home/forwhat.cn/.ssh/id_rsa。 您的公钥已保存在 /home/forwhat.cn/.ssh/id_rsa.pub 中。 关键指纹为:************************

    现在,请使用 cat 命令输出关键结果: cat /home/forwhat.cn/.ssh/id_rsa.pub

    然后复制它并登录GitBub设置SHH设置,然后问题就解决了。

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 2012-10-20
      • 1970-01-01
      • 2020-03-30
      • 2023-04-01
      • 2013-09-02
      • 2020-04-13
      • 2021-12-15
      • 1970-01-01
      相关资源
      最近更新 更多