SSH and SFTP to an instance

Guidance for Linux and Windows can also be found at http://docs.aws.amazon.com/AWSEC2/latest/UserGuide/AccessingInstances.html.

Here we use PuTTY and FileZilla for Microsoft Windows as examples to demonstrate the process of connecting to an EC2 instance and exchange files.

1| Find IP address of your instance. Click “Instances” on your EC2 Dashboard. Choose the instance you want to connect. Find the column “Public IP” and take note of this IP address.

2| Download PuTTY and PuTTYgen from http://www.chiark.greenend.org.uk/~sgtatham/putty/download.html. No installation needed. Just save them to a folder.

3| Convert .pem file to .ppk file. Open PuTTYgen. Choose “SSH-2 RSA” in the “Parameters” panel. Click “Load”. Choose “All Files (*.*)” and select your .pem file downloaded when you launching your instance and click “Open”. After PuTTYgen loaded the information, click “Save private key” and save the generated .ppk file to a folder. Once the .ppk file is ready you do not need to re-generate it next time. You can copy it to other PCs so that you can access your instances from multiple PCs.

4| SSH to your instance using PuTTY. Open PuTTY. Type in or paste the IP address of your instance to “Host Name (or IP address)”. Click open “SSH” on the left panel and click “Auth”. Click “Browse...” and select you .ppk file generated in the previous step. Then click button “Open”. Use “ubuntu” as username for Ubuntu-based AMI or “ec2-user” for other Linux based AMI. No password needed.

5| Download and install FileZilla from http://docs.aws.amazon.com/AWSEC2/latest/UserGuide/AccessingInstances.html.

6| SFTP to your instance using FileZilla. Open FileZilla. Click “Edit” then click “Settings…”. In the “Settings” click “SFTP” on the left panel. Click “Add keyfile…” on the right panel. Selected the .ppk file generated in Step 3. Then click “OK”. Type in or paste the IP address of your instance to “Host:”. Use “ubuntu” as username for Ubuntu-based AMI or “ec2-user” for other Linux based AMI. Leave “Password:” blank. Type in “22” in “Port:”. Then click “Quickconnect”.