IT9 FELIX blog

Connecting AWS EC2 using SSH

When you are creating the EC2 instance, you have downloaded a key pair (.pem) from AWS.


If you are a Mac user, it is easy:

1). Go to the path where the pem file locates

2). Run “chmod 400 <key file name>.pem” to make sure the key file is set to be private (Can only be viewed by you)

3). Connect to EC2 using the key file

“ssh -i <key file name>.pem ec2-user@<EC2 public IP>”


If you are a Window user, a little trick is needed:

  1. Download the “puttygen.exe” – I have packed puttygen.exe & putty.exe in a zip file: HERE
    You may download the latest version from the official web site:
  2. Go to the directory where your key file (,pem) file locates,
  3. Go to the directory where your key file (,pem) file locates, then look for “All Files
  4. Open the key file (.pem) file
  5. Hit “OK” to proceed
  6. Click “Save private key” as (.ppk) file – it is the key file format using Putty for SSH connection
  7.  Click “Yes” to proceed

  8. Name your key file and ******save it as .ppk file (IMPORTART)
  9.  The key file is now ready, check the public IP of your EC2 (e.g. 13,231,165,55)
  10. ALSO check the Security Groups of your EC2 and make sure that the INBOUND RULE for “Port 22” has been set to Public ( *** IMPORTANT
  11.  Open “Putty” and Go to “Connection -> SSH -> Auth” and browse your key file (.ppk) file
  12. Go to “Session”, enter host name “bitnami@<your EC2 public IP>” – bitnami is the default login username for Bitnami WordPress EC2 AMI. When you are creating your own EC2 instance, default username will then be “ec2-user”.
    Save your session in case you need to log on to your EC2 using SSH later on
  13. DONE!!!

Leave a Reply

Your email address will not be published. Required fields are marked *