EBC EC2

From eLinux.org
Revision as of 14:28, 4 October 2014 by Yoder (talk | contribs) (Connecting to Your Instance: Typo)
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to: navigation, search

thumb‎ Embedded Linux Class by Mark A. Yoder


Here's how to compile a kernel on Amazon Elastic Compute Cloud (Amazon EC2). EC2 is a web service that provides resizable compute capacity in the cloud.

Selecting and Starting a New Instance

  • Go to AWS Management page and click EC2
  • Click Launch Instance
  • Check Free tier only
  • Click Select on the first Ubuntu image
  • The free tier eligible instance will be selected. Click Review and Launch
  • Click Edit security groups
  • Under Source select My IP
  • Click Add Rule
  • Select Type: SSH, Source: Custom IP and enter 137.112.0.0/16, which will allow you to connect from campus.
  • Click Review and Launch
  • Click Launch
  • Select Create a new key pair and enter a name.
  • Click Download Key Pair. Move it to and hand place and run:
$ chmod 400 KeyPair.pem
  • Click Launch Instances

It will take a few minutes for your new instance to launch.

Connecting to Your Instance

  • Click View Instances
  • Click on your new instance, details about it will appear below
  • Note the Public IP address.

To connect to your EC2 machine run

$ ssh -i KeyPair.pem ubuntu@Public IP

You should now be logged in!

Don't forget, the instance will keep running until you terminate it. You get a year of free service, after that you will be charged. Be sure to turn it off when you are done.

Connecting More Easily

You have to type a lot to do a simple ssh. Here's how to save some typing.

$ sudo vi /etc/hosts

Add a line like:

54.165.3.13   ec2

where the number is your ec2 machine's IP address.

$ vi ~/.ssh/config

and add

Host ec2
  User ubuntu
  UserKnownHostsFile /dev/null
  StrictHostKeyChecking no
  IdentityFile ~/.ssh/KeyPair.pem

Now you can login with

$ ssh ec2

You can even copy to and from with

$ scp local_file ec2:remote_file


thumb‎ Embedded Linux Class by Mark A. Yoder