Steps to create and connect to a Linux EC2 instance using SSH from the local windows system.
Here are the steps to create and connect to a Linux EC2 instance using SSH from a local Windows system as an AWS Cloud Engineer:
Step 1: Sign in to the AWS Management Console
Go to the AWS Management Console (https://aws.amazon.com/).
Sign in with your AWS account credentials.
Step 2: Launch an EC2 Instance
From the AWS Dashboard, navigate to the EC2 service.
Click on "Launch Instance" to create a new virtual machine.
Step 3: Choose an Amazon Machine Image (AMI)
- Select an Amazon Machine Image (AMI) that suits your needs. Typically, you'll choose a Linux-based AMI, such as Amazon Linux, Ubuntu, or CentOS.
Step 4: Choose an Instance Type
- Choose the desired instance type based on your requirements, such as the amount of CPU and memory.
Step 5: Configure Instance Details
- Configure the instance details, including the number of instances, network settings, and IAM role if needed.
Step 6: Add Storage
- Configure the storage for your EC2 instance. You can specify the root volume size and add additional volumes if required.
Step 7: Add Tags (Optional)
- You can add tags to your instance for easy identification.
Step 8: Configure Security Group
- Create or select a security group that allows SSH (port 22) access. Ensure that the source is set to your IP or a specific range.
Step 9: Review and Launch
- Review your instance configuration and click "Launch" when you're ready.
Step 10: Create a Key Pair
- If you don't already have a key pair, you'll need to create one. This key pair will be used to authenticate to your EC2 instance securely.
Step 11: Download the Key Pair
- After creating the key pair, download the .pem private key file to your local Windows system.
Step 12: Launch the EC2 Instance
- Click "Launch Instances" to start the EC2 instance.
Step 13: Connect to the EC2 Instance
Open a terminal on your Windows system (you can use PowerShell or a terminal emulator like Git Bash).
Use the SSH command to connect to your EC2 instance using the downloaded .pem key file. Replace "YourPrivateKey.pem" with the actual path to your key file and "YourInstanceIP" with the public IP address of your instance.
ssh -i "YourPrivateKey.pem" ec2-user@YourInstanceIP
Step 14: You should now be connected to your Linux EC2 instance via SSH.
That's it! You've successfully created and connected to a Linux EC2 instance from your local Windows system. Make sure to secure your private key and keep it safe.