Lab 1:To Launch Amazon Linux EC2 instance
Lab 1:To Launch Amazon Linux EC2 instance
OBJECTIVE:To launch Amazon Linux instance and to connect from linux and windows client PC.
TOPOLOGY
Note:This lab helps to launch your first instance quickly,so it doesn't cover all possible options.
PRE_REQUISTES:
User should have AWS account,or IAM user with EC2 full access.
TASK:
Launch Amazon Linux instance
Select Region
Select Amazon machine image(AMI)
Create key pair
Connect to amazon linux instance from linux client PC using SSH.
Connect to amazon linux instance from Windows client PC using putty/puttygen.
Start/stop/terminate instance.
1.To launch Amazon Linux instance in Default VPC
Open the Amazon EC2 console
select Compute
click on EC2 service
Select the Region,"us west(oregon)"
Note:Select the region which is nearest to your Geographical Location.
Drag down and check service status & Availability Zone status:
From the" EC2Dashboard"panel
Select instance
click on "Launch instance" button
on choose an Amazon Machine image(AMI)"page
select "Quick start"
Select "Amazon Linux AMI",and click select button
[Notice that this AMI is marked "Free tier eligible."]
on"choose an instance Type"page
select type"t2.micro",eligible for the free tier.
click on"Next :configure instance Details" Button
on"configure instance Details",page
Leave all values as default
click on"Next:Add storage" button
on"Add storage",page
Leave all values as default
click on"Next:Tag instance" button
on"Add Tags",page
provide following values
key---->Name
value--->linuxvm
click on "Next:configure security Group"button
on"configure security Group",page
select------->create a configure security group
Leave all values as default
Note:By Default for linux instance port 22 i.e..ssh is used
click on"Review and Launch" button
on"Review instance launch",page
Leave all values as default
verify the summary,then drag down
verify the summary
click on Launch Button
On "select an Existing key pair or create a new key pair",box
select "create a new key pair"
Enter key pair name---->keylinux.pem
click on "Download key pair"
Note:Store it in a secure and accessible location.
you will not be able to download the file again after it's created
Click on "Launch an instance"
on Launch status page,go to right bottom cornor
click on "view instance"button
on EC2 Dashboard panel
click on instances
select instances status----------->running
To check instance details like
Decripton,status check,Monitoring,tags
1b)To connect to Amazon linux instance"from linux client operating system.
On"connect to your instances"page see the guide lines to connect to linux instances..
Login to the client PC,Open the terminal and run following commands
First go to folder where your private key file*.pem is stored
Eg:keylinuxvm.pem
#ls
#ll
#chmod 400 keylinux.pem
#ssh-i"keylinuxvm"ec2-user@ec2-54-191-200-74.us-west-2compute.amazonaws.com
Note : ec2-user is the default user for the instance
To know current user in linux
$whoami
To switch to root user in linux
$sudosu
Verify(root user)
#whoami
To logout
#exit
1b)To connect to "Amazon linux instance" from windows client operating system.
Download putty.exe and puttygen from putty.org website
Note:Because putty cannot understand.pem file format,so use puttygen.exe to converting*.pem file into *.ppk format
Click on puttygen.exe fe in windows operating system
Click on Run
Click on Load button
Note:By default,puttygen display only files with the Extension .ppk
So to locate your .pem file
on file names select------->All files (*.*)
Locate keylinuxvm.pem in your folder
Click on open
Click on "save private key"button
Save the file------>keylinuxvm.ppk
Click on save Button
To connect to linux instance Run putty.exe from windows operating system
Run putty.exe
click on Run
On category page provide following values
Host Name(or IP address)---------->Provide public ip or DNS name of the instance
Under connection expand
click on SSH------------->Auth
Select Browse button
provide the path of *.ppk file
click on open button
Verify
putty login screen is for linux
provide user name ec2 -user
Now you had logged in as ec2-user Amazon Data center Linux Machine
To start/stop/terminate instance
On EC2 Dashboard
select the instance
Drop down on Action button
select instance state to start/stop/Reboot/Terminate the instance
Note:
If you are not going to use the instance,terminate the instance,
Otherwise it will be charged if the limit is over after free tier usage
































Comments
Post a Comment