我尝试按照此处编写的方式通过git部署安装Nginx
https://devmarketer.io/learn/deploy-laravel-5-app-lemp-stack-ubuntu-nginx/

但是在AWS下的Ubuntu下。
在安装过程中,我创建了pem fiel,并使用ssh连接到ubuintu系统。

但是用命令推送到服务器

git push production master

我有错误
[email protected]: Permission denied (publickey).
fatal: Could not read from remote repository.

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

我要采取什么步骤才能使git工作?

谢谢!

最佳答案

您必须创建非root用户:

sudo useradd -m nonerootuser

将在/ home /内使用此子目录创建

从本地服务器复制到/home/nonerootuser/.ssh配置文件,id_rsa和id_rsa.pub文件。或创建它们

重新启动服务
 service sshd restart

在使用git之前,您需要切换到该用户。
su -l  nonerootuser

关于git - 在AWS ubuntu服务器下运行的git上的权限被拒绝(公钥)错误,我们在Stack Overflow上找到一个类似的问题:https://stackoverflow.com/questions/55048858/

10-14 16:19
查看更多