Upload Files on Local Machine to Aws Ec2 Instance

  • Provide feedback for information recipe

Groundwork

Y'all can transfer files into and out of a Linux EC2 example from a local computer running Windows past either of these methods:

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

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

Prerequisites

    • You must have created a PuTTY Private Cardinal (.ppk) file as described in the How to Connect to your EC2 Instance using PuTTY V1.1 data recipe. The .ppk file will exist 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 ) volition exist used in the Transferring Files Using WinSCP department and the Transferring Files Using PuTTY Secure Re-create (PSCP) department.

The AWS EC2 Management Console.

Transferring Files Using WinSCP

Download and install WinSCP.

    1. Click on Installation package then use the default installation options.
    2. Start WinSCP by clicking on the Desktop icon.
    3. WinSCP Login window.
      1. Click on New Site ( one ).
      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 ( two )
      2. Under Private primal file ( 3 ), click on the push and navigate to the folder where your PuTTY Private Fundamental (.ppk) file is located.
        • Select the .ppk file.
      3. Click on the OK button to close the Advanced Site Settings window.

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

Note: If you end your EC2 instance and restart it, a new Public DNS will be assigned. Y'all volition demand to copy and paste this into the WinSCP "Host proper noun" box before yous can connect.

    1. Click the Login push button
    2. The first time you connect to your instance, you will be asked most connecting to an unknown server.
      1. Click the Yes button to proceed.
    3. After you have continued, the left pane of the window will brandish the file contents of your reckoner and the correct 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 driblet the products from EC2 to your calculator.

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

Transferring Files Using PuTTY Secure Copy (PSCP)

Open a Windows "Command Prompt" window

Windows x

    1. Click on the Start push at the extreme left of the Taskbar.
    2. Scroll down the list of Apps to the Windows Organisation folder.
    3. Expand the folder and click on Command Prompt.
    4. Or, click the Beginning button and type "cmd." Select "Command Prompt" from the search results.
    5. The Command Prompt window volition open up.
The Windows Command Line.
The Windows ten Taskbar.

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 Control Prompt volition open up.
The Windows Command Line.
The Windows 7 Taskbar.

Notation: When using PSCP to transfer files betwixt your estimator and your EC2 instance, your "PuTTY Individual Key (.ppk)" file must exist in the binder you are working in, or y'all 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 binder 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:/habitation/ubuntu/

Instance: To move the file S1A_EW_GRD.nothing from your Windows Downloads folder to the /home/ubuntu directory of your EC2 example.

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

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

    1. At the command prompt, type the PSCP control, which includes your .ppk filename (and path if necessary), the name of the file you desire to transfer, the "Public DNS" of your EC2 case, and the path to a binder in your case:

C:\> pscp -i awskey.ppk S1A_EW_GRD.zip ubuntu@ec2-52-89-147-172.us-east2.compute.amazonaws.com:/habitation/ubuntu/

Command syntax (brackets signal optional paths to your .ppk file and the file y'all want to move if they are non in the binder you are in):

Windows command prompt — copy a file into your EC2 instance.

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:/abode/ubuntu/yourfilename C:\[local_destination_path]\[folder]

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

If you lot 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 control syntax would be:

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

Example: Move a product generated from an application out of your EC2 instance Product directory to the Information folder on your Windows calculator.

    1. Utilize Windows File Explorer to move a copy of my awskey.ppk file to your "Information" 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 modify directory (cd) control:

C:\> cd Data           and press ENTER

    1. At the control 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 ubuntu@ec2-52-89-147-172.us-east2.compute.amazonaws.com:/home/ubuntu/Production/F2_unw_phase.tif C:\data_files

Windows command prompt — transfer files.

Control syntax (brackets indicate optional paths to your .ppk file and the file you want to move if they are non 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 exist transferred from your EC2 example to your computer earlier you lot terminate the example!

johnsonovertaker.blogspot.com

Source: https://asf.alaska.edu/how-to/data-recipes/moving-files-into-and-out-of-an-aws-ec2-instance-windows/

0 Response to "Upload Files on Local Machine to Aws Ec2 Instance"

Post a Comment

Iklan Atas Artikel

Iklan Tengah Artikel 1

Iklan Tengah Artikel 2

Iklan Bawah Artikel