【问题标题】:Trying to clone repo from Google Cloud Source Repositories using SSH authentication尝试使用 SSH 身份验证从 Google Cloud Source Repositories 克隆 repo
【发布时间】:2019-04-27 04:26:29
【问题描述】:

我正在尝试从 Google Cloud Resource Repositories 克隆一个空的存储库。到目前为止,我有:

  • Google Cloud Source Repositories 上创建了一个空的存储库。
  • 从我的本地计算机 (Windows 10) 生成了一个 ssh 密钥(默认名称“id_rsa”)。
  • Cloud Source RepositoriesRegister SSH Key 部分注册了公钥 (id_rsa.pub) 的内容。
  • 打开 Git Bash 并运行 git clone ssh://blah@gmail.com@source.developers.google.com:2022/p/some-project/r/some-repository

但是,它会因以下响应而失败:

Cloning into 'some-repository'...
Enter passphrase for key '/c/Users/blah/.ssh/id_rsa':
fatal: could not fetch refs from ssh://blah@gmail.com@source.developers.google.com:2022/p/some-project/r/some-repository

我正在从 Windows 10

运行 Git Bash

它确实在 Cloud Resource Repositories 上将 SSH 身份验证 标记为 BETA,这让我怀疑它是否还没有完全发挥作用。有人设法通过 SSH 连接到 Cloud Resource Repositories 吗?

非常感谢任何帮助或建议。谢谢

【问题讨论】:

    标签: git ssh google-cloud-repository


    【解决方案1】:

    首先尝试使用不带密码的 SSH 密钥,并确保创建它with the legacy format

    ssh-keygen -m PEM -t rsa -P ""
    

    -m PEM 用于生成旧格式)

    这将覆盖您之前的密钥:注册新的id_rsa.pub 内容,然后重试。

    【讨论】:

    • 感谢您的建议。我已经尝试过不使用密码,但它也不起作用。现在我已经求助于使用“谷歌云 SDK”
    • @GlenAu-Yeung 您是否尝试过使用 -m PEM:这是生成旧格式密钥的重要部分。
    • 非常感谢 - 它成功了。最后,我创建了一个带有密码的密钥,但按照您的建议使用了 -m 选项。但是,我在 ssh-keygen 的手册页或文档中的 -m 选项上找不到任何内容。您介意指导我到哪里可以找到有关此选项的更多信息吗?
    猜你喜欢
    • 2022-12-17
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2013-08-07
    • 1970-01-01
    • 2015-11-11
    • 2018-10-12
    • 2023-03-21
    相关资源
    最近更新 更多