Friday, 6 May 2022

How to Connect to an EC2 instance on AWS using PUTTY? | SpringBoot-Deploying to AWS EC2 Instance

🚀 Master Cloud Deployment!

Want more AWS and Spring Boot tutorials? Subscribe to Ram N Java today!

SUBSCRIBE ON YOUTUBE

Introduction

Connecting to an Amazon EC2 instance from a Windows machine typically requires a tool called PuTTY. Since AWS provides private keys in .pem format and PuTTY uses .ppk, you'll also need the PuTTY Key Generator (PuTTYgen). In this guide, we'll walk through the entire conversion and connection process.

Step 1: Install PuTTY and PuTTYgen

Download the PuTTY installer for Windows from the official website. This installer usually includes both the PuTTY client and PuTTYgen. Complete the installation before proceeding to the next step.

Step 2: Convert .pem to .ppk using PuTTYgen

AWS gives you a .pem file, but PuTTY needs a .ppk file. Here is how to convert it:

  1. Open PuTTYgen.
  2. Click Load and select your .pem file (ensure "All Files" is selected in the file browser).
  3. Once loaded, click Save private key.
  4. Give it a name and save it as a .ppk file.

Step 3: Get Your EC2 Connection Details

Log in to your AWS Console and go to the EC2 Dashboard:

  • Ensure your instance is Running.
  • Copy the Public IPv4 address or Public IPv4 DNS.
  • Note the default username (usually ec2-user for Amazon Linux).

Step 4: Configure the PuTTY Connection

  1. Open PuTTY.
  2. In the Host Name field, paste your IP address or DNS.
  3. Go to Connection > Data and enter your username (e.g., ec2-user) in the "Auto-login username" field.
  4. Go to Connection > SSH > Auth, click Browse, and select your .ppk file.
  5. Go back to Session, give it a name (like "My-EC2"), and click Save.

Step 5: Connect and Verify

Click Open. If a security alert pops up, click "Yes." You should now be logged into your AWS EC2 terminal!

Pro Tip: Remember that stopping and starting your instance changes its Public IP address unless you are using an Elastic IP!

Conclusion

You have successfully configured PuTTY to access your AWS environment. This setup is the gateway to deploying applications, managing databases, and exploring the power of the cloud. Stay tuned for more tutorials on Spring Boot deployment!

No comments:

Post a Comment

Tutorials