How to SSH into an Amazon EC2 Instance Using PuTTY in Windows

How to SSH into an Amazon EC2 Instance Using PuTTY in Windows
Hello fellow data scientists and software engineers! Today, we are going to talk about a topic that is crucial in our field – Secure Shell (SSH) into an Amazon EC2 instance using PuTTY in Windows. SSH is a secure network protocol that lets you remotely access network services over an unsecured network. PuTTY is a free and open-source terminal emulator that supports various network protocols, including SSH. We will walk you through the entire process in this blog post.
What is Amazon EC2?
Amazon Elastic Compute Cloud (Amazon EC2) is a web service that provides scalable computing resources in the cloud. It allows you to run applications on the Amazon Web Services (AWS) infrastructure. By creating virtual servers—known as instances—you can develop, deploy, run, and scale your applications easier than ever.
What is PuTTY?
PuTTY is an open-source emulator that’s widely used as an SSH and Telnet client. Its primary function is to connect from a Windows client to a Linux server. It provides a user-friendly interface for configuring SSH connections and is perfect for the Windows environment.
Step-by-Step Guide to SSH into an Amazon EC2 Instance Using PuTTY
Step 1: Download and Install PuTTY
First, download the PuTTY installation package from the official PuTTY website. After downloading the .msi file, run it and follow the prompts to install PuTTY on your system.
Step 2: Get Your EC2 Instance Details
Next, log into your AWS Management Console, navigate to the EC2 Dashboard, and then to ‘Instances’. Here, you will find the list of your instances. Select the instance you want to connect, and take note of the ‘IPv4 Public IP’.
Step 3: Convert Your EC2 Key Pair
Amazon EC2 uses public key cryptography to encrypt and decrypt login information. When you create an instance, you’ll receive a private key file (.pem). However, PuTTY uses its own file format (.ppk). So, we need to convert the .pem file to .ppk.
Open PuTTYgen (included in the PuTTY installation package), click ‘Load’ and select your .pem file. After loading, click ‘Save private key’, and save the file with .ppk extension.
Step 4: Connect to Your EC2 Instance
Open PuTTY, and in the ‘Session’ category, enter the ‘IPv4 Public IP’ of your instance into the ‘Host Name (or IP address)’ field. Expand the ‘SSH’ category and select ‘Auth’. Click ‘Browse’ and select your .ppk file saved in the previous step.
Click ‘Open’ to initiate the connection. If this is your first time connecting to the instance from this machine, you’ll see a security alert. Click ‘Yes’ to continue.
Step 5: Login to your EC2 Instance
In the terminal window, log in as ‘ec2-user’ (or ‘ubuntu’, ‘root’, etc., depending on your instance type), and you’re now connected to your Amazon EC2 instance!
Conclusion
SSH into Amazon EC2 instances using PuTTY in Windows is a straightforward process that involves downloading and installing PuTTY, getting your EC2 instance details, converting your key pair, and finally, logging into your instance. By following these steps, you can easily manage your EC2 instances from your Windows machine.
Remember that security is paramount when working with AWS services. Always protect your private keys and follow the best practices for securing your instances.
I hope this guide was helpful. For more technical posts, stay tuned!
Tags: #AmazonEC2 #SSH #PuTTY #DataScience #CloudComputing #AWS #SoftwareEngineering
About Saturn Cloud
Saturn Cloud is your all-in-one solution for data science & ML development, deployment, and data pipelines in the cloud. Spin up a notebook with 4TB of RAM, add a GPU, connect to a distributed cluster of workers, and more. Join today and get 150 hours of free compute per month.