Take the 2-minute tour ×
Server Fault is a question and answer site for professional system and network administrators. It's 100% free, no registration required.

I`m new to EC2 and I'm having some problems setting up my first instance. I followed this guide: http://www.robertsosinski.com/2008/01/26/starting-amazon-ec2-with-mac-os-x/ with the difference that I used

ec2-run-instances --instance-type t1.micro ami-7f418316 -k ec2-keypair

to create my instance. When I try going to the public dns provided (ec2-107-22-254-80.compute-1.amazonaws.com) I can't load the page. I tried running the command

ssh -i ec2-keypair root@ec2-107-22-254-80.compute-1.amazonaws.com/

but received this message in the terminal:

ssh: Could not resolve hostname ec2-107-22-254-80.compute-1.amazonaws.com/: nodename nor servname provided, or not known

How do I properly set up a free micro instance on EC2?

share|improve this question
add comment

1 Answer

up vote 6 down vote accepted

You need to leave the trailing slash off of the hostname when you ssh. I.e.,

ssh -i ec2-keypair root@ec2-107-22-254-80.compute-1.amazonaws.com

Tip: Instead of asking Amazon to create your ssh keypair for you, you can upload your own ssh public key to EC2. This makes the ssh command much easier as you don't have to always specify "-i ec2-keypair".

I wrote an article that describes how to set this up:

Uploading Personal ssh Keys to Amazon EC2
http://alestic.com/2010/10/ec2-ssh-keys

share|improve this answer
    
Actually, it turns out I also need to use ec2-user instead of root, so it will be: ssh -i ec2-keypair ec2-user@ec2-107-22-254-80.compute-1.amazonaws.com –  ThePiachu Oct 8 '11 at 18:59
1  
You can also put the EC2 keypair in your ~/.ssh/config. –  ceejayoz Oct 8 '11 at 18:59
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.