We help IT Professionals succeed at work.
Get Started

Unable to SSH into ec2 instance or open it in browser

Last Modified: 2014-11-12
Hello Experts,

Trying to install a AWS ec2 instance. Tried the following steps but unable to ssh to the instance or open the instance url in the browser.. kindl help me out. Thanks in advance.

Step1: Created a keypair
(prompt$) ec2-add-keypair ubuntuInstance10.4Keypair1
KEYPAIR	ubuntuInstance10.4Keypair1	87:11:8f:c9:c5:53:14:6e:2a:92:07:20:03:7a:10:fb:7a:01:07:c3

<keypair code here>


Step2: Saved the above private key in a file (ubuntuInstance10.4Keypair1)

Step3: Changing the permissions of the private key
(prompt$) sudo chmod 600 ID_RSA_ubuntuInstance10.4Keypair1 

Step4: Running the instance having the AMI as "ami-5ed62337"

(prompt$) ec2-run-instances ami-5ed62337 -t t1.micro -k ubuntuInstance10.4Keypair1
RESERVATION	r-22efba4f	791715039698	default
INSTANCE	i-aa558cc5	ami-5ed62337			pending	ubuntuInstance10.4Keypair1	0		t1.micro	2011-03-27T15:12:51+0000	us-east-1d	aki-754aa41c			monitoring-disabled					ebs		
(prompt$) ec2-describe-instances
RESERVATION	r-22efba4f	791715039698	default
INSTANCE	i-aa558cc5	ami-5ed62337	ec2-67-202-5-28.compute-1.amazonaws.com	ip-10-204-202-127.ec2.internal	running	ubuntuInstance10.4Keypair1	0t1.micro	2011-03-27T15:12:51+0000	us-east-1d	aki-754aa41c			monitoring-disabled		ebs		
BLOCKDEVICE	/dev/sda1	vol-296a5541	2011-03-27T15:13:08.000Z	

Step5: Authorizing the port (this command failed)
(prompt$) ec2-authorize default -p 22
Client.InvalidPermission.Duplicate: The permission '' has already been authorized on the specified group

Step6: SSHing to the instance (This command failed)
(prompt$) sudo ssh -i ID_RSA_ubuntuInstance10.4Keypair1 root@ec2-67-202-5-28.compute-1.amazonaws.comip-10-204-202-127.ec2.internal
ssh: Could not resolve hostname ec2-67-202-5-28.compute-1.amazonaws.comip-10-204-202-127.ec2.internal: Name or service not known

Also tried to open the instance(ami-5ed62337) in browser as http://ec2-67-202-5-28.compute-1.amazonaws.comip-10-204-202-127.ec2.internal
this resulted in the following messages

"Oops! Google Chrome could not find ec2-67-202-5-28.compute-1.amazonaws.comip-10-204-202-127.ec2.internal"

Open in new window

Watch Question
This problem has been solved!
Unlock 2 Answers and 3 Comments.
See Answers
Why Experts Exchange?

Experts Exchange always has the answer, or at the least points me in the correct direction! It is like having another employee that is extremely experienced.

Jim Murphy
Programmer at Smart IT Solutions

When asked, what has been your best career decision?

Deciding to stick with EE.

Mohamed Asif
Technical Department Head

Being involved with EE helped me to grow personally and professionally.

Carl Webster
CTP, Sr Infrastructure Consultant
Ask ANY Question

Connect with Certified Experts to gain insight and support on specific technology challenges including:

  • Troubleshooting
  • Research
  • Professional Opinions
Did You Know?

We've partnered with two important charities to provide clean water and computer science education to those who need it most. READ MORE