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?