There are two different ways to transfer files from local Windows machine to EC2 instance remote host.
- Through FTP
- Through SSH
What is SSH?
SSH is a secure shell network to communicate between two machines securely even in not so secure network. The most significant feature of SSH is that the communication between two computers is encrypted, which makes it suitable for use on insecure networks too.
SSH is usually used to perform preferred operations, example – implementation of SSL certificate and definitely to transfer data and files too.
SSH is usually preferred when your hosting is usually on cloud, such as Amazon AWS.
What is FTP?
FTP is Files Transfer Protocol, we generally use tools such as FileZilla to transfer files between two machines. Example – transferring files between local to remote host.
FTP client tool is the most easiest mode of file transfer. All you need to do is (1) Connect to your remote host, (2)locate required path and (3) Drag-drop files from your local machine to remote host.
OK, so this covers the basic description of SSH and FTP.
So in this tutorial we shall learn how to how to connect windows local machine to remote AWS EC2 instance.
We use Putty, an open source application tools to connect local windows machine to remote EC2 instance on AWS.
One very important element you require to establish this connection is ‘.pem’ key, which you would have downloaded while creating/launching your AWS EC2 instance. Please keep ‘.pem’ key handy before starting this procedure.
Step1: Download PuTTY files
- Visit https://www.putty.org/ and download Putty package (exe and putty.exe) that is relevant to your windows machine version. Our Windows machine is 64-bit and we downloaded relevant application files from the below marked links.
Step2: Convert your Key-pair from ‘.pem’ to ‘.ppk’ format
- Open PuTTY Key Generator Application (exe), and then click on ‘Load’ button,
- Find your ‘.pem’ file which was downloaded while launching your instance
- This procedure will convert you key-pair from ‘.pem’ to ‘.ppk’ format
- Allot a key name and click on ‘Save private Key’ to save the same.
Step3: Configure your PuTTY and connect to remote machine from your local machine
- Now go to your EC2 instance
- Copy your Public DNS (IPv4) value
- Open putty.exe (PuTTY configuration application)
In the ‘Host Name’, you will have to type your SSH username, which will be either “user” or ‘bitnami” or ‘ubuntu’, followed by ‘@’ and paste your copied Public DNS (IPv4) value. Which will look like – [email protected] value.
To find your SSL username – https://docs.bitnami.com/aws/faq/get-started/find-credentials/
- On the left column of your pop-up, select ‘SSH’ and select ‘Auth’
- Click on browse button to select your ‘.ppk’ key-pair file
- Select ‘session’ on left column
- Click on ‘Open’ and the ‘Yes’
- And you are done. Your SSH connection is successfully established.