【发布时间】:2017-11-06 01:08:29
【问题描述】:
我正在尝试在一台服务器中克隆一个私有 GitHub 存储库,我试图在虚拟机上启动并运行该存储库。
无论我做什么,我都会收到以下错误:
Permission denied (publickey).
fatal: Could not read from remote repository.
Please make sure you have the correct access rights
and the repository exists.
我已经尝试了很多东西。对于初学者,我通过关注GitHub's tutorial 确保我正确地制作了我的 rsa 密钥。我还确定我在 ~/.ssh/id_rsa.pub 找到的公共 rsa 密钥已正确复制到我的 GitHub 帐户的 ssh 密钥中。
我在~/.ssh/config 的配置文件如下所示:
Host *
AddKeysToAgent yes
UseKeychain yes
IdentityFile ~/.ssh/id_rsa
我尝试克隆一个公共存储库和一个私有存储库,但都不起作用。
当我去克隆存储库时,我正在执行以下命令:
sudo git clone git@github.mit.edu:<GitHub Name>/<Repo Name>.git
如果我在没有sudo 的情况下执行命令,则会收到以下错误:
fatal: could not create work tree dir '<Repo Name>'.: Permission denied
当我执行所有这些操作时,我处于 Python 虚拟环境中。这有什么不同吗?
我一直在阅读与此问题相关的 Stack Overflow 帖子,但它们都没有帮助我解决我的问题。
任何帮助将不胜感激!谢谢!
【问题讨论】:
-
不要使用
sudo -
所以当我不使用
sudo时,我会收到错误fatal: could not create work tree dir '<Repo Name>'.: Permission denied