Cloud Computing Basics
- Describe the high level concepts of cloud computing and virtualization
- Login to a remote machine through SSH
- Start and terminate an Amazon Elastic Compute (EC2) instance
Resources:
- 5 minute video explaining SSH key pairs
cloud computing
At a high level, cloud computing means you pay for what you use as you go, rather than investing a large amount of money up front in physical infrastructure. For me, the most convincing argument for cloud computing is that it’s more efficient, and therefore cheaper.
Virtualization means you have a logical computer, not a physical computer. An instance is a logical computer that you can login to and use like a normal computer. You pay the entire time instances run, so turn them off when you’re done.
ssh and key pairs
For our class, the server is a remote machine that you login to, and the client is your local desktop or laptop. SSH (for secure shell) means to login to a shell on the server from the client.
We will use key pairs rather than passwords to authenticate to our servers.
A key pair consists of a public key that AWS stores, and a private key file that you store. Together, they allow you to connect to your instance securely. For Linux AMIs, the private key file allows you to securely SSH into your instance.
Think of your private key as your password. If someone has your private key, then they can authenticate as you.
Exercise
Prerequisite: Activate your AWS educate account
19 out of 34 of you have already done this.
Find an email from support@awseducate.com
with subject line “Your AWS Educate Application”.
The body starts like this:
Hi -
Your educator has invited you to join AWS Educate and access a “Classroom” for your course work. A “Classroom” is a hands-on learning environment for you to access AWS services and practice AWS. There are no costs or fees to access a Classroom.
If you cannot find it, then let me know, and I’ll resend the invite. Follow the steps and click through the email links to create and activate your account.
- Login to your AWS Educate account
- Navigate to “My Classrooms” on the top bar, find our class, “Analyzing and Processing Big Data”, and click “Go to classroom”, which will bring you to Vocareum.
- Click on the blue “AWS Console” button to navigate to the AWS Management Console
- Launch an EC2 instance.
- Choose “Community AMIs” and search for “stat196k” to find one with a title like “CSUS stat196k v1.0”. Select that one, which has all the software and settings necessary for our class.
- Use the default instance type, “t2.micro”, then click “Review and Launch”.
- You’ll see a warning message: “Improve your instances’ security. Your security group, launch-wizard-2, is open to the world.”. That’s OK here, it just means anyone with valid credentials can login from any IP address.
- When you launch, AWS will prompt you for a key pair. The first time, you’ll have to create a key pair, and subsequently you can use these keys. Alternatively, you can import your own existing public key from the management console.
- For simplicity, I suggest you name the key pair your name with the date that you create it, for example,
clark-2020-02-01
. - Download the key, and verify that your instance is running.
- Click on your running instance, and then click “Connect”.
- Follow the commands on the SSH client to login to the running machine using the keys you just created. For me on a mac, it looks like the following:
~/Downloads $ ssh -i "clark-2020-02-01.pem" ec2-user@ec2-35-173-178-203.compute-1.amazonaws.com
- Once you login, print out the contents of the
README
file in your home directory, and your name. Take a screenshot. - Go back to the console, and figure out how to terminate your running instance. From Instances, take a screenshot showing the “Instance state” as “Terminated”, as well as your email.
Submit these 2 screenshots on Canvas
The red boxes in the pictures below show what I’m looking for.
Show that you were able to login to the machine, $ cat README
and $ echo "your name"
.
Show that the instance is now terminated.