In this project, the goal is to launch an EC2 (Elastic Compute Cloud) Linux instance on Amazon Web Services (AWS) and establish a secure connection to it using the command-line interface (CLI) and SSH (Secure Shell) protocol.
Sign in to the AWS Management Console and navigate to the EC2 service
From the EC2 Dashboard go and select Launch instance.
Choose an Amazon Machine Image (AMI) for the Linux server. You can choose from various Linux distributions available.
Select the instance type that suits your requirements. Consider the CPU, memory, storage, and network capacity you need.
In Key pair select Create new key pair. This key pair will be used to securely connect to the instance via SSH.(make sure to download and securely store the private key file (.pem) in a safe location.)
Configure Network setting including subnet, security group, etc. If you're not sure, you can use the default settings.(Allow SSH (port 22) access. By default, incoming SSH traffic is blocked for security reasons.)
Configure the storage options for your instance. You can specify the size of the root volume and add any additional volumes if needed. Review all the configuration details you've set for the instance. If everything looks good, click on "Launch" to start the instance.
Once the instance is running, you can connect to it using the CLI. Open your terminal or command prompt and navigate to the directory where your key pair file is stored.
Go to the Ec2 instance. At the bottom of the screen, you will see a section called "Connect". Click on the "Connect" button. In the connection dialog, you will see different options for connecting to your instance, such as EC2 Instance Connect, Session Manager, and SSH. Select the "SSH client" tab. Here, you will find the SSH command that you can copy and paste into your CLI. and then press Enter to connect to your EC2 instance.