0

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.

3
  • What is the error msg you are getting while you are trying to connect ? Check for the correct fqdn of the server. Commented Sep 8, 2014 at 16:49
  • run ssh -vvv -i xxx_yyy.pem [email protected] and then post the output. Commented Sep 9, 2014 at 6:00
  • I found the issue, my security group did't allow me to connect with ssh, have created own security group with ssh enabled and then launched the instance fixed the issue. Thanks a lot for your help Rajarshi and slayedbylucifer. Commented Sep 9, 2014 at 8:58

1 Answer 1

1

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.

Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.