Reputation: 1260
I'm creating a new instance by using the following command,
ec2-run-instances --key "xxxx keypair" --instance-type t1.micro --instance-initiated-shutdown-behavior terminate --user-data-file myscript.sh $ami_id
And my AMI is bitnami default AMI
after I launch the instance, used the following code from my older instance to connect new instance,
ssh -i xxx_yyy.pem [email protected]
And I can't connect this, there is no response from server,
Can anyone please help me in this??
Thanks in advance.
Upvotes: 0
Views: 137
Reputation: 269861
Typical things to check when trying to connect to an EC2 instance:
Security Groups Check that at least one of the Security Groups associated with the instance has port 22 (SSH) or port 3389 (RDP) open to your source IP range (eg a specific IP address 54.87.23.11/32, or the whole world 0.0.0.0/0 -- but the latter is very poor security practice). Security Groups are stateful, so you only need to open Inbound access and the return path will automatically work.
Public IP Address Confirm that you are using a Public IP address associated with the instance. This can either be assigned at instance launch (which will allocate a random IP address from a pool) or can be assigned as an Elastic IP Address (which is a static IP address that you can assign assign to any instance and you keep it until you release it back to AWS).
Public Subnet / Routing Confirm that your instance is in a "Public" VPC Subnet. This means that the Route Table associated with the Subnet has a route through an Internet Gateway.
AMI Operating System I've seen situations where people try to SSH to a Windows instance, or RDP to a Linux instance, so also check that you launched the correct AMI for your expected operating system.
Upvotes: 1