How to connect to Amazon EC2 Instance using PuTTY?

How to connect to Amazon EC2 Instance using PuTTY?

In this post, I will show you how to connect to Amazon EC2 Instance using PuTTY.

Required Tools

To connect to Amazon EC2 Instance using PuTTY, you need 2 tools

  1. PuTTYgen - To convert your .pem file to .ppk file. Because PuTTY accepts .ppk file only.

  2. 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:

  1. Open PuTTYgen and click on the 'load' button.

  2. Change the file type to 'All Files(".")' and locate your .pem file.

  3. Click on your .pem file. Now, the PuTTYgen Notice dialog box appears, click on the 'OK' button.

  4. Now, click on the 'Save private key' button.

  5. Now, the PuTTYgen Warning window appears, click on the 'Yes' button to save your key file without a passphrase to protect it.

  6. Type the ppk file name of your choice and click on the 'Save' button.

  7. 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:

  1. Open up PuTTY

  2. Find your Host Name in your 'AWS Management Console' by clicking on the 'connect' button in your Instances page.

  3. 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'

  4. Now paste the copied host name to the PuTTY.

  5. Now click on the 'Data' menu under 'Connection' section in the left side menu.

  6. 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.

  7. Copy your EC2 instance 'username'. In most cases your username will be 'ubuntu'.

  8. Paste your username in the 'Auto-login username' input box of PuTTY Configuration.

  9. Expand 'SSH' menu under 'Connection' section on the left side menu.

  10. Click on the 'Auth' menu under 'SSH' section and locate your myKey.ppk by clicking on the 'Browse...' button.

  11. Move to 'Session' section in the top of the left side menu and do the following:

    1. Type the session name of your choice.
    2. Click on the 'Save' button.
  12. PuTTY Configuration is over. To Connect to your EC2 instance via PuTTY. Do the following:

    1. Open PuTTY
    2. Click on your Saved Sessions Name
    3. Click on the 'Open' button
  13. 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.

Meet the Author