Reference no: EM133702034
WORKING WITH AMAZON ELASTIC COMPUTE CLOUD (AMAZON EC2) INSTANCES AND AMAZON MACHINE IMAGES
TASKS:
Log on to AWS Academy using your AWS Academy starter account and click on the AWS Console button.
Launch a new instance using the Amazon EC2 console, in your default Region/Availability Zone.
Select the Amazon Linux AMI.
Choose the t2.micro instance type.
Launch the instance in the default virtual private cloud (VPC).
Assign the instance a public IP address (of your choice) and add a tag to the instance of Key: Name, Value: MDSC-MCYB6210- YourName.
Create a new security group called MDSC-MCYB6210-Group-YourName.
Add a rule to the group MDSC-MCYB6210-Group-YourName, allowing Secure Shell (SSH) access from any IP address.
Launch the instance and, when prompted for a key pair, create a new public-private key pair-MDSC-MCYB6210Key-YourName. Download the private key (a .pem file) to your workstation.
In the AWS Academy Canvas Page, click on SSH Access to EC2 Link, and choose the option based on the Operating System on the computer you are using for this lab.
Run the chmod command on the key file, as follows: chmod 400 MDSC-MCYB6210Key-YourName
SSH into the instance using the public IP address, the user name ec2-user, and the MDSC-MCYB6210Key-YourName .pem file. The command format is:
ssh -i ‘<private_key_name>.pem' ec2- user@<external_IP_Address_of_Instance>
Use relevant Unix commands to navigate through the directory structure of your AWS t2 instance and view the types of folders and files available.
Close the SSH session by typing the exit command.
Return to the AWS console and terminate the instance you created.
Tip: Assuming you launched the instance with the vockey key pair, and that you have opened TCP port 22 in the instance's security group, you can also SSH to an EC2 instance by using the terminal to the side of these instructions. The terminal already has the key pair available to it. Simply enter the command ssh -i ~/.ssh/labsuser.pem ec2-user@<public-ip> where <public-ip> is the actual IPv4 public address of the instance.
These instructions are for Windows users only.
You will use PuTTY to SSH to Amazon EC2 instances. If you do not have PuTTY installed on your computer, download it here
Open putty.exe
Configure PuTTY to not timeout:
This allows you to keep the PuTTY session open for a longer period of time.
Choose Connection
Set Seconds between keepalives to 30
Configure your PuTTY session: Choose Session
Host Name (or IP address): Copy and paste the IPv4 Public IP address for the instance. To find it, return to the EC2 Console and choose Instances. Check the box next to the instance and in the Description tab copy the IPv4 Public IP value.
Back in PuTTy, in the Connection list, expand SSH
Choose Auth (don't expand it) Choose Browse
Browse to and select the .ppk file that you downloaded Choose Open to select it
Choose Open
Choose Yes, to trust the host and connect to it.
When prompted login as, enter: ec2-user This will connect you to the EC2 instance.
These instructions are for Mac/Linux users only.
Read through the two bullet points in this step before you start to complete the actions, because you will not be able see these instructions when the AWS Details panel is open.
Choose the AWS Details link above these instructions.
Choose the Download PEM button and save the labsuser.pem file.
Typically your browser will save it to the Downloads directory.
Open a terminal window, and change directory cd to the directory where the .pem file was downloaded. For example, run this command, if it was saved to your Downloads directory:
cd ~/Downloads
Change the permissions on the key to be read only, by running this command: chmod 400 labsuser.pem
Return to the AWS Management Console, and in the EC2 service, choose Instances. Check the box next to the instance you want to connect to.
In the Description tab, copy the IPv4 Public IP value.
Return to the terminal window and run this command (replace <public-ip> with the actual public IP address you copied): ssh -i <filename>.pem ec2-user@<public-ip>
Type yes when prompted to allow a first connection to this remote SSH server.
Be sure to review the Learning Resources before completing this activity. Click the weekly resources link to access the resources.
BY DAY 7
Submit a report summarizing your experiences with carrying out the tasks and including screenshots of the tasks you performed.
Refer to the Week 1 Lab 1 Rubric for specific grading elements and criteria. Your Instructor will use this grading rubric to assess your work.