Set Up AWS EC2 Instance: RedHat Enterprise Linux 8 (RHEL 8)
Join the DZone community and get the full member experience.
Join For FreeAmazon EC2 instances are the most widely used Virtual Machines. In general, EC2 or Elastic Compute Cloud instances run on the hypervisors, it's like a remote computer running a Windows or Linux OS on which you can install whatever software you want, including a Web Server running PHP application and a Database Server.
In this article, I'm gonna show you how to set up an AWS EC2 instance - RedHat Enterprise Linux (RHEL8) and to access it remotely using SSH client from a local computer.
PREREQUISITES:
- AWS Account
- Any SSH Client Application (I'm using Git Bash https://gitforwindows.org/ for this tutorial)
INSTRUCTIONS:
1. Log in to AWS Management Console, under Services, Click the EC2
2. In EC2 Menu, click Instances
3. Click Launch Instance to create a new instance
4. Choose your Amazon Machine Image, in this tutorial I'm gonna select RHEL 8 64-bit (x86), then click Next
5. Choose the desire Instance Type, click Next
6. On this page, you can configure your desire VPC settings, configure the number of instances for scaling and assign an IAM Role. In my case, I'm gonna leave the default values, click Next
7. Configure your desire storage capacity, click Next
8. Just click Next if you don't want to add a custom tag for your instance.
9. On this page, I'm gonna create a new Security Group and add a rule for SSH port 22
The Source will be my public IP address which will allow me to connect remotely from my computer via SSH.
You can get your own public IP address here https://www.whatismyip.com/what-is-my-public-ip-address/
10. Review the configuration and click Lunch
11. On the Dialog Box, select the Create a new key pair and provide a value for the Key Pair Name.
Download the PEM file by clicking Download Key Pair button, we will use the PEM file for SSH authentication.
Click Launch Instances once you have the PEM file.
12. The newly created instance status should be running, take note of the Public DNS of the EC2 instance, we will use this on our SSH client.
13. Open the Git Bash, execute the command ssh -i <PEM file> <username>@<Public DNS>
The default username for RHEL is ec2-user.
You should be able to login successfully.
That's it, hope this helps!
Opinions expressed by DZone contributors are their own.
Comments