首页 > 解决方案 > 能够通过 SSH 连接到远程服务器,但无法 git push 生产

问题描述

我正在按照本指南第 12 步了解如何在远程服务器上设置推送到生产。

当我尝试 git push production master 时出现访问被拒绝错误。

user@example.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 root@example.com 登录。

我在 Windows 上使用 Putty 和 Laragon。

标签: gitsshputtycmder

解决方案


这个问题的解决方案是通过删除当前的生产遥控器并专门使用 root 用户重新添加它来完成的。


推荐阅读