0

I am doing my first project for school that uses AWS, so me and my group created some accounts, and everyone could connect to their VMs except me. I spent the next hour following different guides, googling, and using my macbook, my windows computer, and a linux computer to attempt to connect to my VM, but no matter what I did, aws would ask me for a password.

A new EC2 aws instance doesn't need a password, it uses a .pem publickey file. When I attempted to SSH with -v on, all I got was this:

debug1: Authentications that can continue: publickey,password
debug1: Next authentication method: publickey
debug1: Trying private key: testin.pem
debug1: Authentications that can continue: publickey,password
debug1: Next authentication method: password

After trying everything I could think of, even with one of my friends key/vm that he could connect to, I tried changing one of the last variables. I disconnected my laptop from my home network, and connected to a wifi hotspot on my phone... low and behold it worked.

Why can I not connect to an amazon EC2 instance using a key-pair on my home network?

1
  • 1
    Can you check the ssh logs directly on the AWS instance?
    – arielnmz
    Commented Oct 2, 2017 at 20:28

2 Answers 2

1

The problem was with my router and "port forwarding".

I had port 22 forwarded to my personal server, but I forgot to limit that to a specific destination or incoming interface. Due to my local masquerade, all outgoing port 22 traffic was being redirected to my personal server.

I feel like an idiot.

1
  • Everyone makes mistakes, and that one is understandable. I suggest you leave this question up so others can learn from it.
    – Tim
    Commented Oct 3, 2017 at 0:40
0

This could be your service provider that is filtering ssh (TCP port 22).

Give them a call and ask.

1
  • This seems relatively unlikely
    – Tim
    Commented Oct 3, 2017 at 0:39

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .