How to Transfer Files Between your Local Machine to Your Linux Instance

On a Windows machine:

  1. Download any jpg or gif image to your local machine and name the file background.jpg or background.gif depending on the file type.
  2. Download the Filezilla client.
  3. Select Edit -> Settings -> Connection -> SFTP.
    1. Press Add key file… button.
    2. Locate and select your .pem key file.
    3. Click OK in the bottom left pane.
  4. Select File->Site Manager
    1. Press New Site
    2. Add IP address to Host field.
    3. Set Port field to 22
    4. Set Protocol to SFTP: SSH File Transfer Protocol
    5. Set Logon Type to Normal
    6. Set User to ec2-user
    7. Clear Password field
    8. Select OK
  5. Below the File menu option select the arrow for Open Site Manager.
    1. Choose the Site you created in step 4.
  6. Once a connection is established you can drag and drop files from your local machine to the Linux instance and vice-versa.

On a Mac machine, don’t be a wimp and use Filezilla. Do the following:

  1. Download any jpg or gif image to your local machine and name the file background.jpg or background.gif depending on the file type.
  2. Open up the Terminal application.
  3. Identify the absolute path to your .pem key file.
  4. Change directory to the location of the image you downloaded.
  5. Type the following command:

sftp -i PATH_TO_KEY_FILE/XXX.pem ec2-user@YOUR_IP_ADDRESS

where PATH_TO_KEY_FILE is the absolute path to your key file, XXX.pem is the name of your keyfile and YOUR_IP_ADDRESS is (wait for it) your IP address.

  1. Once logged into the remote machine with sftp, use the cd and ls commands to change the current working directory to where you want the uploaded file to be copied.
  2. Copy the file from your local machine to the current working directory of the remote machine using the following command:

put background.jpg

  1. You can quit out of sftp by using the quit command.

© 2017, Eric. All rights reserved.