【问题标题】:Git clone failing on public key. Is there something I'm missing?Git 克隆在公钥上失败。有什么我想念的吗?
【发布时间】:2012-02-11 01:32:04
【问题描述】:

由于 Bundle 安装在 win 7 上对来自 theRubyRacer、JSON 和其他 gem 的 libv8 依赖项造成阻塞,我正在尝试安装并在 Ubuntu 上运行。复制了 .gitconfig 和 .ssh/rsa_id 和 .ssh/rsa_id.pub 文件,但尝试私有 repo 的 git 克隆,在 win7 上工作但在 linux 上失败(使用相同的公钥):

james@ubuntu:/documents/projects/$ sudo git clone git@github.com:the_project/back_end
[sudo] password for james: 
Cloning into back_end...
Permission denied (publickey).
fatal: The remote end hung up unexpectedly

与win7的:

C:\test>git clone git@github.com:the_project/back_end
Cloning into back_end...
Enter passphrase for key '/c/Users/AJames/.shh/id_rsa':
remote: Counting objects: 10034, done.

有什么想法吗?谢谢!!

【问题讨论】:

  • AJP,我已经删除了您在 Amber 的答案中编辑的“显式解决方案”。即使出于某种深不可测的原因,您对项目目录的世界可读性和可写性感到满意,在答案中留下像 chmod 777 这样的命令,而没有解释任何新手遇到的影响和危险是最糟糕的鲁莽行为。

标签: linux git ssh public-key


【解决方案1】:

使用sudo 会导致它尝试使用root 的SSH 密钥,而不是您自己的。

您可能真的应该授予自己访问要克隆到的目录的权限,或者克隆到您已经有权访问的目录中。

【讨论】:

  • 我在我的系统中使用 root 来运行“捆绑安装”。 Root 可以访问任何地方,但我有同样的问题。会发生什么?
  • 这不是访问问题,而是它试图使用 root 的 ssh 密钥而不是你自己的。
猜你喜欢
  • 2017-08-20
  • 2015-07-11
  • 1970-01-01
  • 2011-06-11
  • 2021-01-13
  • 2019-05-10
  • 1970-01-01
  • 2014-09-03
  • 2023-04-09
相关资源
最近更新 更多