首页 > 解决方案 > 致命:无法从远程存储库 Laravel Forge 读取

问题描述

部署时出现此错误,但能够提交和推送代码。发生此问题后,我已删除以前的开发人员存储库。我尝试在服务器上生成新的 ssh 密钥,然后将其添加到新的存储库,但 github 显示密钥已在使用消息。

git@github.com: Permission denied (publickey).
fatal: Could not read from remote repository.

Please make sure you have the correct access rights
and the repository exists.

我该如何解决这个问题?我只想使用我的新存储库进行部署。

标签: githubssh-keysforge

解决方案


您可以浏览 Nash 的“解决 Laravel Forge 中的常见公钥问题”中列出的常见原因列表:

  • Forge 应该能够访问您的服务器
    • 密钥应该注册在Servers -> YOUR SERVER -> Server Details -> Meta -> Forge's Public Key
    • 并且您需要通过 SSH 连接到您的服务器并将此密钥添加到/home/forge/.ssh/authorized_keys文件和/root/.ssh/authorized_keys文件中。
  • 您的服务器应该能够访问您的 Git 存储库。
    您的服务器的公钥需要添加到您的 Git 存储库服务(例如 GitHub、Bitbucket)中。
  • 您的计算机应该能够访问您的 Git 存储库和您的服务器
    检查您自己的~/.ssh/id_rsa.pub

另请参阅“ forge-docs / SSH Keys ”。


推荐阅读