简体   繁体   English

尝试从本地 PC 克隆 EC2 存储库时权限被拒绝(公钥)

[英]Permission denied (publickey) when trying to clone EC2 repository from local PC

I am trying to clone a git repository that I have setup on my ubuntu EC2 instance.我正在尝试克隆我在 ubuntu EC2 实例上设置的 git 存储库。

git clone ssh://ubuntu@test.myurl.com/var/git/testcase.git This is run on my local windows computer. git clone ssh://ubuntu@test.myurl.com/var/git/testcase.git这是在我的本地 Windows 计算机上运行的。

It results in the error Permission denied (publickey). Could not read from remote repository.它导致错误Permission denied (publickey). Could not read from remote repository. Permission denied (publickey). Could not read from remote repository.

I am unable ot understand why this is not working.我无法理解为什么这不起作用。 I already used ssh-add C:\\Users\\Username\\Docouments\\MyKey.PEM This PEM file shouldn't be the problem because I can SSH into the server via Putty with that same PEM file.我已经使用了ssh-add C:\\Users\\Username\\Docouments\\MyKey.PEM这个 PEM 文件应该不是问题,因为我可以使用相同的 PEM 文件通过 Putty SSH 进入服务器。

EDIT编辑

Result of running ssh -v ubuntu@test.myurl.com运行ssh -v ubuntu@test.myurl.com结果

OpenSSH_6.6.1, OpenSSL 1.0.1f 6 Jan 2014 debug1: Reading configuration data /etc/ssh/ssh_config debug1: /etc/ssh/ssh_config line 19: Applying options for * debug1: Connecting to test.myurl.com [51.**.***.166] port 22. debug1: Connection established. debug1: identity file /home/ubuntu/.ssh/id_rsa type -1 debug1: identity file /home/ubuntu/.ssh/id_rsa-cert type -1 debug1: identity file /home/ubuntu/.ssh/id_dsa type -1 debug1: identity file /home/ubuntu/.ssh/id_dsa-cert type -1 debug1: identity file /home/ubuntu/.ssh/id_ecdsa type -1 debug1: identity file /home/ubuntu/.ssh/id_ecdsa-cert type -1 debug1: identity file /home/ubuntu/.ssh/id_ed25519 type -1 debug1: identity file /home/ubuntu/.ssh/id_ed25519-cert type -1 debug1: Enabling compatibility mode for protocol 2.0 debug1: Local version string SSH-2.0-OpenSSH_6.6.1p1 Ubuntu-2ubuntu2.4 debug1: Remote protocol version 2.0, remote software version OpenSSH_6.6.1p1 Ubuntu-2ubuntu2.4 debug1: match: OpenSSH_6.6.1p1 Ubuntu-2ubuntu2.4 pat OpenSSH_6.6.1* compat 0x04000000 debug1: SSH2_MSG_KEXINIT sent debug1: SSH2_MSG_KEXINIT received debug1: kex: server->client aes128-ctr hmac-md5-etm@openssh.com none debug1: kex: client->server aes128-ctr hmac-md5-etm@openssh.com none debug1: sending SSH2_MSG_KEX_ECDH_INIT debug1: expecting SSH2_MSG_KEX_ECDH_REPLY debug1: Server host key: ECDSA 8d:3c:a9:08:a3:42:63:13:f8:b9:b7:bc:6e:4b:c6:44 debug1: Host 'test.myurl.com' is known and matches the ECDSA host key. debug1: Found key in /home/ubuntu/.ssh/known_hosts:1 debug1: ssh_ecdsa_verify: signature correct debug1: SSH2_MSG_NEWKEYS sent debug1: expecting SSH2_MSG_NEWKEYS debug1: SSH2_MSG_NEWKEYS received debug1: SSH2_MSG_SERVICE_REQUEST sent debug1: SSH2_MSG_SERVICE_ACCEPT received debug1: Authentications that can continue: publickey debug1: Next authentication method: publickey debug1: Trying private key: /home/ubuntu/.ssh/id_rsa debug1: Trying private key: /home/ubuntu/.ssh/id_dsa debug1: Trying private key: /home/ubuntu/.ssh/id_ecdsa debug1: Trying private key: /home/ubuntu/.ssh/id_ed25519 debug1: No more authentication methods to try. Permission denied (publickey).

Try this in your ~/.ssh/config :在你的~/.ssh/config试试这个:

Host test.myurl.com
    IdentityFile C:\Users\Username\Docouments\MyKey.PEM
    User ubuntu

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

相关问题 尝试从GitHub克隆时权限被拒绝(publickey)错误 - Permission denied (publickey) error when trying to clone from GitHub 尝试克隆Git时,权限被拒绝(公钥) - Permission denied (publickey) when trying to Git Clone 向亚马逊 ec2 推送提交时权限被拒绝(公钥) - Permission denied (publickey) when pushing commit to amazon ec2 从bitbucket克隆git repo时权限被拒绝(publickey) - Permission denied (publickey) when clone git repo from bitbucket 通过git ssh ec2:权限被拒绝(公钥) - ssh ec2 via git: permission denied (publickey) 亚马逊EC2 + Capistrano + Git:权限被拒绝(publickey) - Amazon EC2 + Capistrano + Git: Permission denied (publickey) Git Clone:权限被拒绝(publickey)。 致命:无法从远程存储库读取 - Git Clone : Permission denied (publickey). fatal: Could not read from remote repository 尝试匿名克隆 github 存储库时权限被拒绝 - Permission denied when trying to anonymously clone a github repository 无法将项目从本地推送到AWS中设置的git存储库:权限被拒绝(公钥) - Unable to push project from local to git repository set up in AWS : Permission denied (publickey) Heroku:权限被拒绝(公钥)。 致命的:执行git push时无法从远程存储库读取 - Heroku: Permission denied (publickey). fatal: Could not read from remote repository when doing git push
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM