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 http://aws.amazon.com 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

Advertisements

Installing the necessary software on an AWS Amazon Linux AMI server

There is a variety of software you will need to get your new AWS web server up and running. You probably already have the desktop clients if you every did any server work previously, the core server software however will need to be installed, depending on your purposes for the server.

This page will be updated from time to time as new installation and configuration guides are added.

Desktop Clients

Software Description Available at: Documentation
PuTTy Free SSH client. Utilizes basic command line style interface www.putty.org TXT version | HTML version
WinSCP Free SCP/SFTP/FTP client for Windows. Offers a graphical user interface to move and edit files. www.winscp.net HTML version

I am bias to Windows software. All of these programs run on Windows XP and Windows 7 (32-bit & 64-bit systems). If you are running a Linux or Mac system….well…they may work. The program’s name link will go to instructions on configuring the software to access your AWS Instance.

Core Server Software

Software Usage Description Documentation
Apache2 Website hosting The basic web server which deals with internet (http/https) traffic to the server. http://httpd.apache.org/
PHP Dynamic Websites (optional)
Requires:Apache2
Scripting language for creating dynamic webpages. Used by most CMS, Wiki & Blog systems to manage content http://www.php.net/
MySQL Database The basic free SQL database server. Used by many CMS, Wiki & Blog systems to store content. http://www.mysql.com/
phpMyAdmin Database Administration (optional)
Requires:Apache2, PHP & MySQL
Graphical, HTML based admin tool for accessing and managing mySQL databases. http://www.phpMyAdmin.net/
Postfix Mail-Transfer-Agent (ie: email server) Accepts and sends email. Versatile and can be used with a variety of database structures. http://www.postfix.com/
Courier Email Client Portal (optional)
Requires:Postfix
Offers a portal to access email via any client, including MS Outlook, Thunderbird & smart phones. Offers IMAP and POP3 systems. http://www.courier-mta.org/
Spamassassin Email Spam filter (optional)
Requires:Postfix
Works with MTAs to prevent spam from arriving on server http://spamassassin.apache.org/
BIND9 DNS Server (optional) DNS server which allows you to create your own dns records. http://www.bind9.net

Note all of these programs are free, and most are open source. All of the installation instructions are specific to the Amazon Linux AMI. This stripped down version of Linux is a special Amazon derivative of Fedora. When I was originally setting up our servers, some of the differences between RedHat, Ubuntu, Debian and this version of Linux drove me crazy, therefore all of these instructions worked on the newest Amazon Linux AMI version (currently 2012.03).