gitLab:证书问题,缺少 ssh public 密钥
gitLab: certificat issue, missing ssh public key
我无法理解它是如何工作的以及需要做什么。
我有一个 GitLab 帐户,并成功生成了私人和 public 证书,以便提供对它的访问。我完成了 https://gitlab.com/help/ssh/README#generating-a-new-ssh-key-pair 描述的所有步骤。现在我决定创建一个新项目并同步 gitLab 项目和我在本地创建的项目之间的状态。因为我可以访问我用来创建两个证书的机器,所以我只是将 public 密钥从一台机器(位于 ~/.ssh 文件夹中)复制到我正在使用的当前机器(在 ~/.ssh 中文件夹)。但它没有任何作用。我什至无法执行 git 克隆命令。
~> git clone git@gitlab.com:[myUser]/[myProject].git
Cloning into 'gate-controller'...
git@gitlab.com: Permission denied (publickey).
fatal: Could not read from remote repository.
Please make sure you have the correct access rights
and the repository exists.
我试图找出原因并执行
~> ssh -vT git@gitlab.com
但老实说,我无法理解这种反应。我在 ssh 文件夹中没有看到对我的 public 密钥文件的任何引用。
你能支持我解决问题并理解,问题是什么?
非常感谢
更新:
您需要在您尝试 pull/push 的任何机器上使用私钥。当使用具有您的 public 密钥的服务进行身份验证时(任何 git 服务,如 Github、Gitlab 等都将具有),您需要在身份验证时使用您的私钥。
您可以在此处 https://www.ssh.com/pki/
阅读有关 ssh(git 在您不使用 HTTPS 身份验证时使用)和 PKI(Public 密钥基础设施)的更多信息
我无法理解它是如何工作的以及需要做什么。
我有一个 GitLab 帐户,并成功生成了私人和 public 证书,以便提供对它的访问。我完成了 https://gitlab.com/help/ssh/README#generating-a-new-ssh-key-pair 描述的所有步骤。现在我决定创建一个新项目并同步 gitLab 项目和我在本地创建的项目之间的状态。因为我可以访问我用来创建两个证书的机器,所以我只是将 public 密钥从一台机器(位于 ~/.ssh 文件夹中)复制到我正在使用的当前机器(在 ~/.ssh 中文件夹)。但它没有任何作用。我什至无法执行 git 克隆命令。
~> git clone git@gitlab.com:[myUser]/[myProject].git
Cloning into 'gate-controller'...
git@gitlab.com: Permission denied (publickey).
fatal: Could not read from remote repository.
Please make sure you have the correct access rights
and the repository exists.
我试图找出原因并执行
~> ssh -vT git@gitlab.com
但老实说,我无法理解这种反应。我在 ssh 文件夹中没有看到对我的 public 密钥文件的任何引用。
你能支持我解决问题并理解,问题是什么?
非常感谢
更新:
您需要在您尝试 pull/push 的任何机器上使用私钥。当使用具有您的 public 密钥的服务进行身份验证时(任何 git 服务,如 Github、Gitlab 等都将具有),您需要在身份验证时使用您的私钥。
您可以在此处 https://www.ssh.com/pki/
阅读有关 ssh(git 在您不使用 HTTPS 身份验证时使用)和 PKI(Public 密钥基础设施)的更多信息