Permission denied to connect to Amazon EC2 using SSH at Windows 8

Everton Mendonça

I'm starting using Amazon EC2 service. I have installed an Amazon Linux instance, set the PEM file, opened the SSH ports and installed a GIT service.

My local environment it's Windows 8.

Through putty and WinSCP I can connect without problems. I have followed the docs and converted my PEM file to a PPK and everything works fine. The problem is when I try to do a git push from my local machine. I always get a "permission denied (public key)" when I try to connect. I have made a ssh-add to PEM file using the git bash, generated a custom key trough the GIT Bash and added this key to the key pars at the EC2 Instance and nothing works...

If I try (using git bash) a ssh -i and specify the PEM file, I have a connection.

ssh -i c:/[PATH]/[PEM-FILE].pem ec2-user@[HOST].compute.amazonaws.com

If I try without -i, no connection.

$ ssh ec2-user@[HOST].compute.amazonaws.com
Permission denied (publickey).

Here follows the trace with -vT command:

ssh -vT ec2-user@[HOST].compute.amazonaws.com
OpenSSH_4.6p1, OpenSSL 0.9.8e 23 Feb 2007
debug1: Connecting to [HOST].compute.amazonaws.com [54.201.
110.48] port 22.
debug1: Connection established.
debug1: identity file [PATH]/Usuario/.ssh/identity type -1
debug1: identity file [PATH]/Usuario/.ssh/id_rsa type 1
debug1: identity file [PATH]/Usuario/.ssh/id_dsa type -1
debug1: Remote protocol version 2.0, remote software version OpenSSH_6.2
debug1: match: OpenSSH_6.2 pat OpenSSH*
debug1: Enabling compatibility mode for protocol 2.0
debug1: Local version string SSH-2.0-OpenSSH_4.6
debug1: SSH2_MSG_KEXINIT sent
debug1: SSH2_MSG_KEXINIT received
debug1: kex: server->client aes128-cbc hmac-md5 none
debug1: kex: client->server aes128-cbc hmac-md5 none
debug1: SSH2_MSG_KEX_DH_GEX_REQUEST(1024<1024<8192) sent
debug1: expecting SSH2_MSG_KEX_DH_GEX_GROUP
debug1: SSH2_MSG_KEX_DH_GEX_INIT sent
debug1: expecting SSH2_MSG_KEX_DH_GEX_REPLY
debug1: Host '[HOST].compute.amazonaws.com' is known and ma
tches the RSA host key.
debug1: Found key in [PATH]/Usuario/.ssh/known_hosts:1
debug1: ssh_rsa_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: [PATH]/Usuario/.ssh/identity
debug1: Offering public key: [PATH]/Usuario/.ssh/id_rsa
debug1: Authentications that can continue: publickey
debug1: Trying private key: [PATH]/Usuario/.ssh/id_dsa
debug1: No more authentication methods to try.
Permission denied (publickey).

So, there's a way to connect via SSH without the -i option?

Everton Mendonça

After several tries, I found an article with some instructions here https://serverfault.com/questions/194567/how-do-i-tell-git-for-windows-where-to-find-my-private-rsa-key

I followed these steps: "After you have the home directory, and a .ssh folder under that, you want to open PuTTYgen and open the key (.ppk file) you have previously created. Once your key is open, you want to select Conversions -> Export OpenSSH key and save it to HOME.ssh\id_rsa. After you have the key at that location, Git bash will recognize the key and use it"

Collected from the Internet

Please contact [email protected] to delete if infringement.

edited at
0

Comments

0 comments
Login to comment

Related

From Dev

EC2 + ssh: Permission denied (publickey)

From Java

Permission denied (publickey) when SSH Access to Amazon EC2 instance

From Dev

Connecting to Amazon EC2 Instance on Windows 10 bash - Permission denied (publickey)

From Dev

Permission Denied Error when using scp to copy a file to Amazon EC2 instance from Mac OS

From Dev

Permission denied (publickey) when pushing commit to amazon ec2

From Dev

Amazon EC2 instance "Permission denied (publickey)"

From Dev

/etc/profile: Permission denied after restarting Amazon EC2

From Dev

"Permission denied (publickey)" error when ssh'ing to Amazon EC2 Debian AMI 05f3ef71

From Dev

Unable to connect ssh to ec2 through config file in ubuntu. Permission denied (publickey,gssapi-keyex,gssapi-with-mic)

From Dev

Unable to connect to AWS EC2 instance (Permission denied publickey)

From Dev

Aws Ec2 ssh access - permission denied(publickey)

From Dev

ec2 ssh login Permission Denied (publickey)

From Java

Trying to SSH into an Amazon Ec2 instance - permission error

From Dev

How to Edit Apache2.conf | Permission Denied - Amazon AWS (EC2)

From Java

Connect to Amazon EC2 file directory using Filezilla and SFTP

From Dev

permission denied when cloning from GitLab repo hosted on an Amazon EC2 instance

From Dev

Permission denied (publickey) when connecting to EC2 via SSH on Mac Mavericks

From Dev

ssh command from Windows to Mac: permission denied

From Dev

AWS EC2 FTP Permission Denied

From Dev

Permission denied while doplying Tomcat 8 webapp on Amaon EC2

From Dev

SSH to EC2 using Bitvise Tunnelier on Windows

From Dev

SSH an EC2 machine using Windows' Linux Bash Shell

From Dev

AWS OpsWorks SSH Connect directly permission denied (publickey)

From Dev

Can't connect to github via ssh; Permission denied (public key)

From Dev

permission error to SSH EC2 instance

From Dev

ssh to Ubuntu instance on Amazon EC2

From Dev

Amazon EC2 instance of Windows Server 2012- unable to connect to simple webserver

From Dev

Amazon EC2 instance of Windows Server 2012- unable to connect to simple webserver

From Dev

Frozen connection using ssh over Amazon EC2 using ubuntu

Related Related

  1. 1

    EC2 + ssh: Permission denied (publickey)

  2. 2

    Permission denied (publickey) when SSH Access to Amazon EC2 instance

  3. 3

    Connecting to Amazon EC2 Instance on Windows 10 bash - Permission denied (publickey)

  4. 4

    Permission Denied Error when using scp to copy a file to Amazon EC2 instance from Mac OS

  5. 5

    Permission denied (publickey) when pushing commit to amazon ec2

  6. 6

    Amazon EC2 instance "Permission denied (publickey)"

  7. 7

    /etc/profile: Permission denied after restarting Amazon EC2

  8. 8

    "Permission denied (publickey)" error when ssh'ing to Amazon EC2 Debian AMI 05f3ef71

  9. 9

    Unable to connect ssh to ec2 through config file in ubuntu. Permission denied (publickey,gssapi-keyex,gssapi-with-mic)

  10. 10

    Unable to connect to AWS EC2 instance (Permission denied publickey)

  11. 11

    Aws Ec2 ssh access - permission denied(publickey)

  12. 12

    ec2 ssh login Permission Denied (publickey)

  13. 13

    Trying to SSH into an Amazon Ec2 instance - permission error

  14. 14

    How to Edit Apache2.conf | Permission Denied - Amazon AWS (EC2)

  15. 15

    Connect to Amazon EC2 file directory using Filezilla and SFTP

  16. 16

    permission denied when cloning from GitLab repo hosted on an Amazon EC2 instance

  17. 17

    Permission denied (publickey) when connecting to EC2 via SSH on Mac Mavericks

  18. 18

    ssh command from Windows to Mac: permission denied

  19. 19

    AWS EC2 FTP Permission Denied

  20. 20

    Permission denied while doplying Tomcat 8 webapp on Amaon EC2

  21. 21

    SSH to EC2 using Bitvise Tunnelier on Windows

  22. 22

    SSH an EC2 machine using Windows' Linux Bash Shell

  23. 23

    AWS OpsWorks SSH Connect directly permission denied (publickey)

  24. 24

    Can't connect to github via ssh; Permission denied (public key)

  25. 25

    permission error to SSH EC2 instance

  26. 26

    ssh to Ubuntu instance on Amazon EC2

  27. 27

    Amazon EC2 instance of Windows Server 2012- unable to connect to simple webserver

  28. 28

    Amazon EC2 instance of Windows Server 2012- unable to connect to simple webserver

  29. 29

    Frozen connection using ssh over Amazon EC2 using ubuntu

HotTag

Archive