How to Move files in and out of an AWS EC2 Instance – Windows (2024)

Easier

  • Provide feedback for data recipe

Background

You can transfer files into and out of a Linux EC2 instance from a local computer running Windows by either of these methods:

  • WinSCP provides a graphical user interface (GUI) that allows you to drag and drop files between your local computer and your AWS instance. This is similar to using Windows File Explorer.
  • PuTTY Secure Copy is run from the Windows Command Prompt

Processing using an EC2 Instance requires that you move the files to be processed to the instance, and then remove the products created before the instance is terminated.

Prerequisites

  • You must have an AWS account. If you don’t have an account, create one now.

Note: You will need to provide credit card information for your new account.

  • You will need to create and launch a Linux EC2 instance to connect to. Instructions for this are found in the “How to Create a Basic Elastic Cloud Compute (EC2) Instance” data recipe.
  • You will need WinSCP installed.
  • You will need PuTTY SSH client installed.
    • You must have created a PuTTY Private Key (.ppk) file as described in the How to Connect to your EC2 Instance using PuTTY V1.1 data recipe. The .ppk file will be used in Transferring Files Using WinSCP and Transferring Files Using PuTTY Secure Copy (PSCP).

Find Your EC2 Instance Public DNS

  1. Open the AWS Instances window in the EC2 Management Console (1).

The Public DNS of your EC2 instance displayed in this window (2) will be used in the Transferring Files Using WinSCP section and the Transferring Files Using PuTTY Secure Copy (PSCP) section.

Transferring Files Using WinSCP

Download and install WinSCP.

    1. Click on Installation package and then use the default installation options.
    2. Start WinSCP by clicking on the Desktop icon.
    3. WinSCP Login window.
      1. Click on New Site (1).
      2. In the Host name box (2), enter the Public DNS displayed in your EC2 Management Console Instances window.
      3. In the User name box (3), type “ubuntu.”
      4. Click on the Advanced button.
    4. Advanced Site Settings window
      1. Under SSH (1), click on Authentication (2)
      2. Under Private key file (3), click on the button and navigate to the folder where your PuTTY Private Key (.ppk) file is located.
        • Select the .ppk file.
      3. Click on the OK button to close the Advanced Site Settings window.

If you want to save your settings to use again later, click on the Save button in the WinSCP Login window and name the settings.

Note: If you stop your EC2 instance and restart it, a new Public DNS will be assigned. You will need to copy and paste this into the WinSCP “Host name” box before you can connect.

    1. Click the Login button
    2. The first time you connect to your instance, you will be asked about connecting to an unknown server.
      1. Click the Yes button to continue.
    3. After you have connected, the left pane of the window will display the file contents of your computer and the right pane displays the contents of your EC2 instance.
    4. Drag and drop files from your computer into your EC2 instance to process. When processing is complete, drag and drop the products from EC2 to your computer.

Important: Files must be transferred from your EC2 instance to your computer before you terminate the instance!

Transferring Files Using PuTTY Secure Copy (PSCP)

Open a Windows “Command Prompt” window

Windows 10

    1. Click on the Start button at the extreme left of the Taskbar.
    2. Scroll down the list of Apps to the Windows System folder.
    3. Expand the folder and click on Command Prompt.
    4. Or, click the Start button and type “cmd.” Select “Command Prompt” from the search results.
    5. The Command Prompt window will open.

Windows 7

    1. Click on the Start button at the left of the Taskbar.
    2. In the Search programs and files box, type “cmd.” Select “Command Prompt” from the search results.
    3. The Command Prompt will open.

Note: When using PSCP to transfer files between your computer and your EC2 instance, your “PuTTY Private Key (.ppk)” file must be in the folder you are working in, or you must provide a path in the PSCP command to the folder the file is located. For example, if “AWSkey.ppk” file is stored in the folder named “keys,” include this path in the PSCP command:

C:\Users\username\keys\AWSkey.ppk

Copy a File Into Your EC2 Instance

At the Windows command prompt type (notice where spaces are placed):

C:\> pscp -i yourkey.ppk yourfilename ubuntu@public_DNS:/home/ubuntu/

Example: To move the file S1A_EW_GRD.zip from your Windows Downloads folder to the /home/ubuntu directory of your EC2 instance.

    1. Use Windows File Explorer to move your awskey.ppk file to your Downloads folder, or provide a path to the folder your.ppk file is located in.
    2. At the Windows command prompt, navigate to your Downloads folder using the change directory (cd) command:

C:\Users\current_user>cd Downloads and press Enter

    1. At the command prompt, type the PSCP command, which includes your .ppk filename (and path if necessary), the name of the file you want to transfer, the “Public DNS” of your EC2 instance, and the path to a folder in your instance:

C:\> pscp -i awskey.ppk S1A_EW_GRD.zip [emailprotected]:/home/ubuntu/

Command syntax (brackets indicate optional paths to your .ppk file and the file you want to move if they are not in the folder you are in):

C:\> pscp -i C:\<path>\yourkey.ppk C:\<path>\yourfilename ubuntu@public_DNS:/home/ubuntu

Copy a File Out of Your EC2 Instance

At the Windows command prompt type:

C:\> pscp -i yourkey.ppk ubuntu@publicDNS:/home/ubuntu/yourfilename C:\[local_destination_path]\[folder]

Note that the .ppk file must be in the folder you run the command from, or you must include the path to the file in your PSCP command.

If you don’t include a local destination path and folder in the command, the file will download into the folder the command is run from. In this case, the command syntax would be:

C:\> pscp -i C:\[path]\yourkey.ppk ubuntu@publicDNS:/home/ubuntu/[folder]/filename

Example: Move a product generated from an application out of your EC2 instance PRODUCT directory to the Data folder on your Windows computer.

    1. Use Windows File Explorer to move a copy of my awskey.ppk file to your “Data” folder, or provide a path to the folder your.ppk file is located in.
    2. At the Windows command prompt, navigate to your “Data” folder using the change directory (cd) command:

C:\> cd Data and press ENTER

    1. At the command prompt, type the PSCP command, which includes your .ppk filename, the Public DNS of your EC2 instance, and the name of the file you want to transfer.

C:\> pscp -i awskey.ppk [emailprotected]:/home/ubuntu/PRODUCT/F2_unw_phase.tif C:\data_files

Command syntax (brackets indicate optional paths to your .ppk file and the file you want to move if they are not in the folder you are in):

C:\> pscp -i C:\[path]\yourkey.ppk ubuntu@public_DNS:/home/ubuntu/[path]/yourfilename C:\[local_destination_path]

Important: Files must be transferred from your EC2 instance to your computer before you terminate the instance!

How to Move files in and out of an AWS EC2 Instance – Windows (2024)
Top Articles
4 Types of Waste Disposal: Methods and Approaches
How to build a blazingly fast API with Fastify - LogRocket Blog
Katie Pavlich Bikini Photos
Gamevault Agent
Hocus Pocus Showtimes Near Harkins Theatres Yuma Palms 14
Free Atm For Emerald Card Near Me
Craigslist Mexico Cancun
Hendersonville (Tennessee) – Travel guide at Wikivoyage
Doby's Funeral Home Obituaries
Vardis Olive Garden (Georgioupolis, Kreta) ✈️ inkl. Flug buchen
Select Truck Greensboro
Things To Do In Atlanta Tomorrow Night
Non Sequitur
How To Cut Eelgrass Grounded
Pac Man Deviantart
Alexander Funeral Home Gallatin Obituaries
Craigslist In Flagstaff
Shasta County Most Wanted 2022
Energy Healing Conference Utah
Testberichte zu E-Bikes & Fahrrädern von PROPHETE.
Aaa Saugus Ma Appointment
Geometry Review Quiz 5 Answer Key
Walgreens Alma School And Dynamite
Bible Gateway passage: Revelation 3 - New Living Translation
Yisd Home Access Center
Home
Shadbase Get Out Of Jail
Gina Wilson Angle Addition Postulate
Celina Powell Lil Meech Video: A Controversial Encounter Shakes Social Media - Video Reddit Trend
Walmart Pharmacy Near Me Open
A Christmas Horse - Alison Senxation
Ou Football Brainiacs
Access a Shared Resource | Computing for Arts + Sciences
Pixel Combat Unblocked
Cvs Sport Physicals
Mercedes W204 Belt Diagram
Rogold Extension
'Conan Exiles' 3.0 Guide: How To Unlock Spells And Sorcery
Teenbeautyfitness
Where Can I Cash A Huntington National Bank Check
Facebook Marketplace Marrero La
Nobodyhome.tv Reddit
Topos De Bolos Engraçados
Gregory (Five Nights at Freddy's)
Grand Valley State University Library Hours
Holzer Athena Portal
Hampton In And Suites Near Me
Stoughton Commuter Rail Schedule
Bedbathandbeyond Flemington Nj
Free Carnival-themed Google Slides & PowerPoint templates
Otter Bustr
Selly Medaline
Latest Posts
Article information

Author: Rev. Porsche Oberbrunner

Last Updated:

Views: 6306

Rating: 4.2 / 5 (53 voted)

Reviews: 92% of readers found this page helpful

Author information

Name: Rev. Porsche Oberbrunner

Birthday: 1994-06-25

Address: Suite 153 582 Lubowitz Walks, Port Alfredoborough, IN 72879-2838

Phone: +128413562823324

Job: IT Strategist

Hobby: Video gaming, Basketball, Web surfing, Book restoration, Jogging, Shooting, Fishing

Introduction: My name is Rev. Porsche Oberbrunner, I am a zany, graceful, talented, witty, determined, shiny, enchanting person who loves writing and wants to share my knowledge and understanding with you.