Thursday, August 11, 2011

Digg this

Amazon EC2: Moving to the Cloud (2)

page 1 · 2

Create an EC2 Instance
Now, before I actually ssh into an EC2 instance, it would stand to reason that I should have an EC2 instance currently running.  To start an EC2 instance, click on the EC2 tab in the AWS Management Console and then click the Launch Instance button.  Here you can select the type of instance to run.  You can select either a Quick Start instance or a Community Instance.  So, to make this easy I am going to select a Quick Start instance: Basic 32-bit Amazon Linux/Micro

*When selecting an instance, you are charged for what configuration you choose.  Windows costs more than Linux, 64-bit instances typically cost more than 32-bit instances, etc.  So, only chose what you need.  Once again, Amazon's EC2 pricing information can be found at

I accept all of the defaults for my EC2 instance and I select the name of the key pair that I created earlier.  This is very important because your key pair is how you are going to SSH into that instance once it is started.

When your EC2 instance is started, click on it to highlight your instance in the AWS Management Console.  In the frame at the bottom you will see a lot of properties.  The property labeled Public DNS is that address that you will use to SSH into your new EC2 instance.

Amazon EC2 Properties

Log Into Your EC2 Instance
Now, we are ready to log into our Amazon EC2 instance.  Just open up a command prompt and type
ssh -i ~/.ssh/yourAwsKeyPair.pem ec2-user@AwsEc2PublicDns
where yourAwsKeyPair.pem is your private key that you downloaded from AWS and AwsEc2PublicDns is the public DNS address of your EC2 instance.  See the example below.

If you have Windows and you use Putty, follow this link for instructions on how to connect:

Now that you are logged into AWS, you can do pretty much whatever you want.  Some instances even let you login as root instead of ec2-user.  However, any changes that you make to your EC2 instance are lost when you shutdown your instance... unless of course you use Elastic Block Storage (EBS).  But that is a post for another day.


No comments:

Post a Comment