Setting up PuTTY for AWS access

PuTTY is a free open source SSH client. You will need to install it (basically download the installer and run it) if you have not already done so. Make sure you have both PuTTY and PuTTYgen programs.

Configuration for AWS Instance access

These instructions assume you have already setup an AWS instance. If you haven’t setup an AWS Instance, you can find help at “Setting up a Free Tier Amazon EC2 Instance.

  1. Open your AWS Console (go to and login)
  2. Go to “EC2” under “Compute and Networking”
  3. Click on “Instances” under the “Instances” section of the Navigation pane. This will display all of the instances you currently have running. Clicking on the name of the instance will show the details of that instance below. Select the instance you want to configure PuTTY for then find the “Key Pair Name” and “Security Groups” values under the “Description” tab. You will need to edit the security group in order to allow PuTTY to access your instance then confirm the security key with the key pair name.
  4. Find the value for “Public DNS” under the “Description” tab then highlight it (shift+ left click while selecting the text) and press CTRL+C to copy the text. You will need this value when setting up PuTTY and I find copy & pasting a whole lot easier than retyping something.
  5. Click on “Security Groups” under the “Networking & Security” section of the Navigation pane. This will show your security groups for this region. Click on the instance’s security group to see the details of that group.
  6. Click on the “Inbound” tab to edit the firewall associated with this security group.
  7. SSH clients use port 22 for access, so you will need to verify that TCP port 22 (SSH) is listed on the table to the right. If it is not listed, or there is no table, select “SSH” under for “Create a new rule” then add your computer’s ip address to the source line followed by “/32”. AWS security groups use CIDR notation for IP address ranges. Simply, “/32” limits the range to a single IP address. Click “Add Rule” then click “Apply Rule Changes”
  8. Click on “Key Pairs” under the “Networking & Security” section of the Navigation pane. The “Fingerprint” for the “Key Pair Name” will be needed later to confirm your connection to the AWS Instance.
  9. Open PuTTYgen. Click on “Load” then choose the Key Pair file for the “Key Pair Name” of the instance. If you just created the instance following the above instructions, the key file is the one you had to save after you generated the “Key Pair Name.”PuTTYgen Starting Screen
  10. Click “Generate” to create the PuTTY usable security key. Save the file somewhere you will remember and can control, since access to this file will allow access to the AWS instance. Close PuTTYgen.PuTTYgen with Loaded Private Key
  11. Open PuTTY. The default “Category ” should be “Session.” If “Session” is not selected, select it.
  12. Click on the “Host Name (or IP address)” input and press CTRL+C to past your “Public DNS” address as the host name. Make sure “Port” is set to “22” and “SSH” is selected as the “Connection type:”.
  13. Expand the “Connection” Category and expand the “SSH” section and click on “Auth.”
  14. Click on “Browse” and open the Putty key you just created with PuTTYgen.
  15. Click on the “Session” Category again and choose “Save.” This way you won’t have to repeat setting up PuTTY every time you want to use it. NOTE: This is security weakness, because anyone with access to your computer would then be able to access your AWS Instance, however most people have their own private computer which limits the security risk. I just find it a pain to redo everything every time I want to access the server.PuTTY Session Dialog
  16. Click “Open” to open the SSH connection.PuTTY Connection/SSH/Auth Dialog
  17. Type “ec2-user” at the “login as:” prompt. The “ec2-user” is the default user for the Amazon Linux AMI. You cannot login as “root” as a security measure.SSH Login
  18. To transfer to the “root” user, type:

    $ sudo su

9 thoughts on “Setting up PuTTY for AWS access

  1. Pingback: Installing the necessary software on an AWS Amazon Linux AMI server « AVAS Technology

  2. Pingback: Installing and Configuring Apache2 on AWS Amazon Linux AMI « AVAS Technology

  3. Pingback: Installing and Configuring PHP on AWS Amazon Linux AMI with Apache2 « AVAS Technology

  4. Pingback: Installing Common PHP Extensions | AVAS Technology

  5. Pingback: Creating a New Cron Job on AWS Linux AMI | AVAS Technology

  6. Pingback: Installing and Configuring phpMyAdmin on AWS Amazon Linux AMI running Apache2 PHP and MySQL | AVAS Technology

  7. Pingback: Error with phpMyAdmin 3.5.4 showing Blank Screen | AVAS Technology

  8. Pingback: Compressing all HTML pages with Apache2 on AWS | AVAS Technology

  9. Thanks, this was incredibly useful! I just wanted to point out one small error: do NOT “click “Generate” to create the PuTTY usable security key”… that will generate a completely new key, which you don’t want. Instead, you just want to load the key pair as described in step 9, and then click “Save private key”… this will convert the private key into the PuTTY-usable format.

Leave a Reply

Fill in your details below or click an icon to log in: Logo

You are commenting using your account. Log Out /  Change )

Google photo

You are commenting using your Google account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s