Remote access to AWS instance

If you need help to set up an AWS instance, read my previous post.

From the navigation menu of your Amazon EC2 console, click on INSTANCES.

AWS Console

Tick the box to select the new instance and take a note of the web server’s address,

e.g. ec2-00-000-00-000.eu-west-1.compute.amazonaws.com.

Choose the instance

Now go to terminal and type (I assume you are familiar with Secure SHell):

 ssh -i ~/.ssh/webserverkey.pem ubuntu@ec2-00-000-00-000.eu-west-1.compute.amazonaws.com

(you should avoid to access an instance as root, for this reason the user “ubuntu” is automatically created).

If your terminal looks like the one below… well done! You successfully accessed your instance!

Access through terminal

You can also send files from your computer to the instance using Secury CoPy (scp), which syntax is exactly the same as ssh.

Imagine you want to transfer a text file called “test.txt” from your computer (user home folder, ~) to the amazon instance (ubuntu home folder, /home/ubuntu).

Then go to terminal and type:

 scp -i ~/.ssh/webserverkey.pem ~/test.txt ubuntu@ec2-00-000-00-000.eu-west-1.compute.amazonaws.com:/home/ubuntu/

That’s all!

More info here

Advertisements

Set up an Amazon Web Service (AWS) Free Usage Tier

Amazon allows you to use a computer in the cloud for free (for 1 year).

To have a go, visit http://aws.amazon.com/free/ sign up then log in.

This is your AWS Management Console:

AWS Management Console

Click on EC2 and follow the instructions to launch a virtual server, also called Amazon Elastic Compute Cloud (Amazon EC2) instance.

Create a new instance

Just to make things easier, choose the “Quick Launch Wizard”, choose a name for your instance and create a new key pair.

Download the key (e.g. webserverkey.pem) and save it in a folder, e.g. ~/.ssh

To ensure the user can read the key, go to terminal and type:

sudo chmod 400 ~/.ssh/webserverkey.pem

Then choose a launch configuration, e.g. Ubuntu Server 12.04 LTS – 64 bit and click CONTINUE.

Choose the instance

Now you can either edit the details of the newly created instance or launch it.

Details of the instance

When ready, click on LAUNCH then CLOSE.

The instance is ready

You will be automatically redirected to you AWS Management Console which now shows the new instance in the section “My Resources”.

If it doesn’t, just click on REFRESH.

Console

Your instance is ready to use!

To stop or terminate a running instance see read this:

http://support.rightscale.com/06-FAQs/FAQ_0149_-_What%27s_the_difference_between_Terminating_and_Stopping_an_EC2_Instance%3F