This is an old revision of the document!
Connecting to Amazon EC2 Server
With WinSCP you can easily upload and manage files on your Amazon EC2 (elastic cloud) instance/server over SFTP protocol.
Before starting you should:
- Have WinSCP installed;
- Have Amazon EC2 instance running;
- Have enabled inbound SSH traffic from your IP address to your instance;
- Have your key pair ready;
Advertisement
First you need to convert your private key from .pem
format to .ppk
:
- Use PuTTYgen tool for conversion;
- PuTTYgen installs by default with WinSCP. One way to run it is using Tools > Run PuTTYgen command on WinSCP Login dialog.
- In PuTTYgen window, use Conversions > Import command and locate your private key in
.pem
format. - Optionally enter passphrase for the converted key to protect it.
- Save private key to
.ppk
format using Save private key button.
Start WinSCP. Login dialog will appear. On the dialog:
- Make sure New site node is selected.
- On New site node, make sure SFTP protocol is selected.
- Enter your EC2 instance public DSN name into Host name box. If you do not know your instance DNS name, check Public DNS column on Instances page of Amazon EC2 console.
- User name differs with instance type:
- For an Amazon Linux AMI, the user name is
ec2-user
. - For a RHEL5 AMI, the user name is either root or
ec2-user
. - For an Ubuntu AMI, the user name is
ubuntu
. - For a Fedora AMI, the user name is either
fedora
orec2-user
. - For SUSE Linux, the user name is
root
.
- For an Amazon Linux AMI, the user name is
- Press Advanced button to open Advanced site settings dialog and go to SSH > Authentication page.
- In Private key file box select file you have saved your private key in
.ppk
format. - Submit Advanced site settings dialog with OK button.
- Save your site settings using Save button.
- Login using Login button.
- On the first connect you will be prompted to verify server host key. The only way we know how to get host key safely to verify it, is to locate its fingerprint in server’s initial start log (Actions > Get System Log command on Instances page of Amazon EC2 console), when host keys are generated:
Advertisement
Further reading
- Guide to uploading files to SFTP server