简体   繁体   English

推送到ubuntu服务器上的远程git存储库-权限被拒绝(公钥)

[英]push to remote git repository on ubuntu server - Permission denied (publickey)

I am on a windows machine trying to push code up to a remote git repository on an ec2 instance which runs ubuntu. 我在Windows机器上尝试将代码推送到运行ubuntu的ec2实例上的远程git存储库。 I have setup the instance and created a bare repo at a location on the instance. 我已经设置了实例,并在实例上的某个位置创建了一个裸仓库。

I have my public key on the instance cos i can ssh to it via putty and also via openssh software i installed. 我在实例cos上有我的公钥,我可以通过腻子以及我安装的openssh软件将它SSH到它。

i checked out 我签了

https://serverfault.com/questions/39733/why-do-i-get-permission-denied-publickey-when-trying-to-ssh-from-local-ubunt https://serverfault.com/questions/39733/why-do-i-get-permission-denied-publickey-when-trying-to-ssh-from-local-ubunt

git push heroku master Permission denied (publickey) git push heroku master权限被拒绝(公钥)

Git - Permission denied (publickey) Git-权限被拒绝(公钥)

but the suggested solutions were not clear to me 但是建议的解决方案我不清楚

I can ssh into the instance using ssh -i mykey.pem ubuntu@1.1.1.1. 我可以使用ssh -i mykey.pem ubuntu@1.1.1.1进入实例。

Problem is i have added the repo to my list of remotes but i keep getting the following error when i try to push from my local master to the remote repo using 问题是我已将存储库添加到我的遥控器列表中,但是当我尝试使用以下方法从本地主服务器推送到远程存储库时,仍然出现以下错误

production - ssh://ubuntu@ec2-1-1-1-1.compute-1.amazonaws.com

git push production master 

Error 错误

Permission denied (publickey).

fatal: Could not read from remote repository.

Please make sure you have the correct access rights

and the repository exists.

I can ssh into the instance using ssh -i mykey.pem ubuntu@1.1.1.1. 我可以使用ssh -i mykey.pem ubuntu@1.1.1.1进入实例。

This is the problem — you use mykey.pem for ssh but git uses default key. 这就是问题所在–您将mykey.pem用于ssh,但是git使用默认密钥。 You have to configure ssh so that mykey.pem is the default key for that host: 您必须配置ssh以便mykey.pem是该主机的默认密钥:

# .ssh/config
Host ec2-1-1-1-1.compute-1.amazonaws.com
   User ubuntu
   IdentityFile mykey.pem

暂无
暂无

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

相关问题 推送到远程git-server的权限被拒绝(publickey) - Permission denied (publickey) on push into remote git-server Heroku:权限被拒绝(公钥)。 致命的:执行git push时无法从远程存储库读取 - Heroku: Permission denied (publickey). fatal: Could not read from remote repository when doing git push Git:权限被拒绝(公钥)。 致命:无法从远程存储库读取 - Git: Permission denied (publickey). fatal: Could not read from remote repository GIT 权限被拒绝(公钥) - 致命无法从远程存储库读取 - GIT permission denied (publickey) - Fatal could not read from remote repository git remote push:权限被拒绝(publickey,键盘交互) - git remote push : Permission denied (publickey,keyboard-interactive) 在 AWS ubuntu 服务器下运行的 git 上的权限被拒绝(公钥)错误 - Permission denied (publickey) error on git run under AWS ubuntu server 通过 SSH 从远程服务器推送 git commit:权限被拒绝(公钥)。 致命:无法从远程存储库读取 - Pushing git commit from remote server through SSH: Permission denied (publickey). fatal: Could not read from remote repository Git:权限被拒绝(公钥)致命 - 无法从远程存储库读取。 克隆 Git 存储库时 - Git: Permission denied (publickey) fatal - Could not read from remote repository. while cloning Git repository Ubuntu LAMP Git克隆权限被拒绝(公钥) - Ubuntu LAMP Git clone Permission denied (publickey) git 推送失败 - 权限被拒绝(公钥) - git push is failing - Permission denied (publickey)
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM