# Spin Up A Linux Machine In No Time!

*Are you someone learning Linux and would love to have a machine spun up on a cloud environment as it would be nice one to learn cloud and Linux simultaneously. Please read on to find out the steps to create a Basic Linux Machine on AWS for learning and training purpose.*

## **Prerequisite:**
Create an AWS Account or if you already have one, you are free to make use of it based on the purpose of the account. Here is a quick link of the documentation to follow
https://aws.amazon.com/premiumsupport/knowledge-center/create-and-activate-aws-account/
Once we have our account ready, we should be good to start.

## Steps to create a basic LINUX Machine for Learning and Training Purpose:

- Login to AWS CONSOLE [https://aws.amazon.com/console/](Link)

- Click on “Services” on the top left corner, in the search box, type “EC2” and hit EC2 on the search results returned.



![image1.png](https://cdn.hashnode.com/res/hashnode/image/upload/v1664301387881/touU3k6Qw.png align="left")

- On the “EC2” service page, click on “Launch Instance”


![img2.png](https://cdn.hashnode.com/res/hashnode/image/upload/v1664214195818/f6fdQrHIS.png align="left")

- Type in a name for the EC2 instance


![img4.PNG.jpg](https://cdn.hashnode.com/res/hashnode/image/upload/v1664301135957/09975ZQQG.jpg align="left")


- Now select the AMI as "Amazon Linux" which is equivalent to RedHatLinux/CentOS



![img5.PNG](https://cdn.hashnode.com/res/hashnode/image/upload/v1664301467622/Q541umptU.PNG align="left")


- Select the instance type as "t2.micro" which is a free tier eligible and then click on "create new key pair"


![img6.PNG](https://cdn.hashnode.com/res/hashnode/image/upload/v1664301512745/9XVZDufVn.PNG align="left")


- Provide a keypair name and select RSA and the private pem file option as shown in the image below



![img7.PNG](https://cdn.hashnode.com/res/hashnode/image/upload/v1664301620554/0Y8xzyv8u.PNG align="left")


- Then click on "create a new key pair"

![img8.png](https://cdn.hashnode.com/res/hashnode/image/upload/v1664301705253/08SLWKTyJ.png align="left")

- The .pem file( private key file for use with SSH) will be downloaded. Please keep it accessible as it is required to be able to access the machine.


![img9.PNG](https://cdn.hashnode.com/res/hashnode/image/upload/v1664301788123/5SdNtInaX.PNG align="left")


- Default network settings please check if the connection is allowed for, anywhere on the internet so we could access the machine using SSH. Though this is not the same thing in a production environment

![img10.png](https://cdn.hashnode.com/res/hashnode/image/upload/v1664301906434/tyRu0by3p.png align="left")


- Check on the storage options and select the magnetic disk as it is more than sufficient for learning purpose

![image11.PNG](https://cdn.hashnode.com/res/hashnode/image/upload/v1664301979352/5r8NM2qEe.PNG align="left")


- Click on Launch instance to spin up a VM


![img13.png](https://cdn.hashnode.com/res/hashnode/image/upload/v1664302534168/5f1NM__Ej.png align="left")

- Check the EC2 service page to check on the status of the VM that is being created


![img14.PNG](https://cdn.hashnode.com/res/hashnode/image/upload/v1664302612557/qIVisjwUn.PNG align="left")


![img15.PNG](https://cdn.hashnode.com/res/hashnode/image/upload/v1664302636744/7JT6QPrmc.PNG align="left")

- Once the VM is fully created and operational, we should be able to see the public IP Address of the machine. This is the IP that can be used to gain access to the machine using SSH

![img16.PNG](https://cdn.hashnode.com/res/hashnode/image/upload/v1664302669161/rnE67mA7B.PNG align="left")

## How to Login to the newly created VM?

I am using MobaXterm  [https://mobaxterm.mobatek.net/download-home-edition.html](Link) to establish SSH Session on to the machine. It is quick and easy to install.

- Open MobaXterm and select SSH at the top left corner


![img17.PNG](https://cdn.hashnode.com/res/hashnode/image/upload/v1664303235125/b6D5vCxQW.PNG align="left")


- Copy the Public IP address of the machine that you are trying to access from AWS Console

![img18.PNG](https://cdn.hashnode.com/res/hashnode/image/upload/v1664303253292/onUAbHEjH.PNG align="left")

- On the Remote Host Field, type in the Public IP Address of the machine. Default user name for ec2 instance is ec2-user 

![img19.png](https://cdn.hashnode.com/res/hashnode/image/upload/v1664303342734/Kqa3VehI-.png align="left")


- Under Advanced SSH Settings . select use private key and upload the .pem file downloaded during the creation of instance and hit ok to gain access to the machine.


![advssh.png](https://cdn.hashnode.com/res/hashnode/image/upload/v1664303803403/9s-MPGWU6.png align="left")


![img21.PNG](https://cdn.hashnode.com/res/hashnode/image/upload/v1664303936873/A5iQnQ6nR.PNG align="left")

Happy Learning! Hope it helped!


# *Community* and *Social* Footprints :
 
- [Vijayalakshmi Bakthavachalam](https://www.linkedin.com/in/vijayatech)
- [GitHub](https://github.com/cloudnloud)
- [Twitter](https://twitter.com/cloudnloud)
- [YouTube Cloud DevOps Free Trainings](https://www.youtube.com/c/CloudnLoud?sub_confirmation=1)
- [Linkedin Page](https://www.linkedin.com/company/80359681/)
- [Linkedin Group](https://www.linkedin.com/groups/9124202/)
- [Discord Channel](https://discord.gg/vbjRQGVhuF)
- [Dev](https://dev.to/cloudnloud)










