DEV Community

Git-Geetansh
Git-Geetansh

Posted on

Launching and Connecting to an AWS EC2 Ubuntu Instance Using PuTTY

Prerequisites :-

Before starting, ensure you have the following:

  1. AWS Account: Sign up for an AWS account if you don’t have one.
  2. PuTTY and PuTTYgen: Download and install PuTTY and PuTTYgen from the official website.
  3. Basic Knowledge: Familiarity with AWS Management Console and basic networking concepts.

Security Best Practices :-

  1. Use IAM Roles: Assign least-privilege IAM roles to your instances.
  2. Regular Updates: Keep your instance’s OS and applications updated.
  3. Security Groups: Implement the least permissive rules for your security groups.
  4. Encryption: Use encrypted EBS volumes and snapshots.
  5. Key Management: Protect your EC2 key pairs and use strong passwords.

Steps to Launch and Connect to an EC2 Instance :-

Step 1: Sign In to AWS Management Console

  1. Go to the AWS Management Console.
  2. Sign in with your AWS credentials. AWS management console

Step 2: Launch an EC2 Instance

  1. Navigate to the EC2 Dashboard by selecting Services > EC2.
  2. Click on Launch Instance.
  3. Choose an Amazon Machine Image (AMI):
    • Search for “Ubuntu” and select the desired version.
  4. Choose an Instance Type:
    • Select t2.micro for free tier eligibility. AMI and instance type
  5. Configure Instance Details:
  6. Keep default settings unless specific configurations are needed.
  7. Add Storage:
    • Default is 8 GB SSD; adjust if necessary.
  8. Add Tags:
    • Add a tag with Key: Name and Value: MyUbuntuInstance.
  9. Configure Security Group:
    • Create a new security group with the following rule: Type: SSH Protocol: TCP Port Range: 22 Source: My IP Security Group
  10. Review and Launch:
    • Click Launch.
  11. Select a Key Pair:
    • Create a new key pair
    • select RSA under key pair type
    • select and download the .ppk file,and keep it secure.

key pair

Step 3 : Connect to Your Instance Using PuTTY

  1. Open PuTTY.
  2. In the Host Name field, copy and paste the public IP address of the instance that you launched. putty
  3. In the Category pane, go to Connection > SSH > Auth > credentials
  4. Browse and select your .ppk file. putty
  5. Click Open to connect.

connected to instance

Conclusion

In this project, we learned how to:

  1. Launch an Ubuntu EC2 instance on AWS.
  2. Apply security best practices to ensure the instance is secure.
  3. Connect to the EC2 instance using PuTTY.

This project demonstrates the practical steps involved in setting up and securing a cloud-based server, which is a valuable skill in today’s tech landscape.

Top comments (0)