How to create and access AWS instance on Linux

create and access AWS instance on Linux

In this article, you will be briefed about how to create and access instance in AWS on Linux Machine. For demonstration am going to install Redhat instance.

Creating and Accessing AWS instance

First, log in to your AWS account and select EC2 from services.

Then, to create an instance you need to click launch instance from Instance menu.

After that, select Redhat instance and proceed to the next step.

And then, select free tier instance type and click next.

And, keep default instance settings and click next.

After, add storage size and type.

Add the tags to your instance.


Configure firewall security group by default am going to allow only ssh protocol for inbound traffic.

You should then cross check your instance configuration.

Create and download the new key pair then click launch icon.

Instance initialization will take few minutes.

Click Connect menu and follow the steps to connect and access the AWS instance on your Linux machine.

Locate to download directory and change the permission for this access key file.

[root@server1 Downloads]# chmod 400 redhat-ec2-ohio-key.pem

Follow the syntax to access instance via ssh

[root@server1 Downloads]# ssh -i " redhat-ec2-ohio-key.pem"  ec2-user@18.220.121.11
The authenticity of host ' 18.220.121.11 (18.220.121.11)'  can' t be established.
ECDSA key fingerprint is SHA256:Tn65xIJA7JyHR+KCP/lErrPHAEtIWZ//NT94KJ6z38E.
ECDSA key fingerprint is MD5:10:11:31:44:e2:7b:44:62:72:4e:fd:0b:24:d9:98:d6.
Are you sure you want to continue connecting (yes/no)? yes
Warning: Permanently added ' 18.220.121.11'  (ECDSA) to the list of known hosts.
[ec2-user@ip-172-31-36-234 ~]$

Now the Redhat instance is accessible to verify the  operating system execute below command.
[root@ip-172-31-36-234 ~]# cat /etc/os-release
NAME=" Red Hat Enterprise Linux Server" 
VERSION=" 7.4 (Maipo)" 
ID=" rhel" 
ID_LIKE=" fedora" 
VARIANT=" Server" 
.
.
.
REDHAT_SUPPORT_PRODUCT_VERSION=" 7.4" 

Install vim editor for testing, you can install any package for your own testing.

[root@ip-172-31-36-234 ~]# yum install vim -y
Loaded plugins: amazon-id, rhui-lb, search-disabled-repos
rhui-REGION-client-config-server-7                                                                                         | 2.9 kB  00:00:00     
rhui-REGION-rhel-server-releases                                                                                           | 3.5 kB  00:00:00     
rhui-REGION-rhel-server-rh-common                                                                                          | 3.8 kB  00:00:00     
(1/7):To rhui-REGION-client-config-server-7/x86_64/primary_db                                                                | 3.3 kB  00:00:00    
.
.
.
.
Installed:
  vim-enhanced.x86_64 2:7.4.160-2.el7
Complete!

With this, the installation comes to an end.

FAQ
Q
Why am I asked to verify my phone number when signing up for Amazon EC2?
A
Amazon EC2 registration requires you to have a valid phone number and email address on file with AWS in case we ever need to contact you. Verifying your phone number takes only a couple of minutes and involves receiving a phone call during the registration process and entering a PIN number using the phone key pad.
Q
How can I get started with Amazon EC2?
A
To sign up for Amazon EC2, click the “Sign up for This Web Service” button on the Amazon EC2 detail page. You must have an Amazon Web Services account to access this service; if you do not already have one, you will be prompted to create one when you begin the Amazon EC2 sign-up process. After signing up, please refer to the Amazon EC2 documentation, which includes our Getting Started Guide.
Q
How to create bucket in AWS EC2?
A
For create the Bucket in AWS EC2, use the following link as given below "https://www.linuxhelp.com/how-to-create-bucket-in-aws-s3/".
Q
What is Amazon Elastic Compute Cloud (Amazon EC2)?
A
Amazon Elastic Compute Cloud (Amazon EC2) is a web service that provides resizable compute capacity in the cloud. It is designed to make web-scale computing easier for developers.
Q
What can I do with Amazon EC2?
A
Just as Amazon Simple Storage Service (Amazon S3) enables storage in the cloud, Amazon EC2 enables “compute” in the cloud. Amazon EC2’s simple web service interface allows you to obtain and configure capacity with minimal friction. It provides you with complete control of your computing resources and lets you run on Amazon’s proven computing environment. Amazon EC2 reduces the time required to obtain and boot new server instances to minutes, allowing you to quickly scale capacity, both up and down, as your computing requirements change. Amazon EC2 changes the economics of computing by allowing you to pay only for capacity that you actually use.