How to connect to Amazon EC2 Instance using PuTTY?
Answer
In this post, I will tell you what is PuTTY and Amazon EC2 instance and how to connect to Amazon EC2 Instance using PuTTY.
What is PuTTY?
PuTTY is open source SSH and telnet client software that allow you to remotely connect to your Amazon EC2 instance to install / update operating system, software, package, and so on.
What is Amazon EC2 Instance?
Amazon EC2 instance is the varying combinations of CPU, memory, storage, and networking capacity that allow you to run your websites.
The best part of the Amazon EC2 instance is that it will allow you to scale your resources to the requirements of your target workload.
Required Tools
To connect to Amazon EC2 Instance using PuTTY, you need 2 tools
-
PuTTYgen - To convert your .pem file to .ppk file. Because PuTTY accepts .ppk file only.
-
Filezilla - To access EC2 instance Remotely.
Download PuTTYgen
Download PuTTYgen (Mine is windows 32-bit).
Download PuTTY
Download PuTTY (Mine is windows 32-bit).
Convert .pem file to .ppk file
To Convert your .pem (that you created when you launched the instance) to .ppk. Do the following:
-
Open PuTTYgen and click on the 'load' button.
-
Change the file type to 'All Files(".")' and locate your .pem file.
-
Click on your .pem file. Now, the PuTTYgen Notice dialog box appears, click on the 'OK' button.
-
Now, click on the 'Save private key' button.
-
Now, the PuTTYgen Warning window appears, click on the 'Yes' button to save your key file without a passphrase to protect it.
-
Type the ppk file name of your choice and click on the 'Save' button.
-
Hurry! you have converted your .pem file to .ppk file successfully.
Setting up PuTTY
Now we will set up PuTTY to access your EC2 instance. To do so, please follow these steps:
-
Open up PuTTY
-
Find your Host Name in your 'AWS Management Console' by clicking on the 'connect' button in your Instances page.
-
The 'Connect to your instance' pop up appears. Copy the Host Name starting from '@'.
My Host name is '@ec2-3-81-164-1.compute-1.amazonaws.com'
-
Now paste the copied host name to the PuTTY.
-
Now click on the 'Data' menu under 'Connection' section in the left side menu.
-
To fill the Auto-login username, find your user name from your 'AWS Management Console' by clicking on the 'connect' button in your Instances page.
-
Copy your EC2 instance 'username'. In most cases your username will be 'ubuntu'.
-
Paste your username in the 'Auto-login username' input box of PuTTY Configuration.
-
Expand 'SSH' menu under 'Connection' section on the left side menu.
-
Click on the 'Auth' menu under 'SSH' section and locate your myKey.ppk by clicking on the 'Browse...' button.
-
Move to 'Session' section in the top of the left side menu and do the following:
- Type the session name of your choice.
- Click on the 'Save' button.
-
PuTTY Configuration is over. To Connect to your EC2 instance via PuTTY. Do the following:
- Open PuTTY
- Click on your Saved Sessions Name
- Click on the 'Open' button
-
Hurray! PuTTY is connected to your EC2 instance.
Note: If your PuTTY is not connecting automatically. Please type your username ('ubuntu') manually or delete the saved session and reconfigure your PuTTY will fix it for you.
Related Post
How to Deploy Node.js App in EC2 instance?
Join Our Channel
Join our telegram channel to get an instant update on depreciation and new features on HTML, CSS, JavaScript, jQuery, Node.js, PHP and Python.
This channel is primarily useful for Full Stack Web Developer.