简体   繁体   中英

Help Accessing Amazon EC2 Instance

Trying to set up first EC2 instance for simple (currently) php app, using osx 10.6. When i try to access my new instance in the command line i can only get ssh: connect to host xx.xxx.xxx.xxx port 22: Operation timed out .

i'm typing this at command line:

ssh -i <MYPEMNAME>.pem ec2-user@<PRIVATEIP/PUBLICDNS/ELASTICIP>

i have this as a security rule in the management console:

rule name: web_access
22(SSH)    0.0.0.0 
80(HTTP)   0.0.0.0

i have ssh completely open just to test this, i'll get a more appropriate ip when it works.

i created an elastic IP, which was one option i tried after 'ec2-user@...'

i also generated a .pem when i created the instance which i have saved to a folder .ec2 on my machine, named as referenced in .pem above.

the management console says the instance is running. i think im just doing the ssh access wrong at this point.

any help tremendously appreciated! thanks

Yeah, comments were pretty correct. It was an ssh issue and the main thing was that i was trying to add a custom security rule that allowed ssh but the default didn't. and for whatever reason the custom rule wasn't being applied so i just edited the default rule to allow port 22 (ssh) and I was pretty much up and running. Also needed to run chmod. !! Anddd, if you add a new keypair like I did, you may need to go into the ssh/known_hosts file and delete reference to your old keypair. that was hanging me up for a while with a an error out a middleman attack.

thanks

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM