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
- 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.
Transferring Files Using WinSCP
Download and install WinSCP.
-
- Click on Installation package then use the default installation options.
- Start WinSCP by clicking on the Desktop icon.
- WinSCP Login window.
- Click on New Site ( one ).
- In the Host name box ( 2 ), enter the Public DNS displayed in your EC2 Management Console Instances window.
- In the User name box ( 3 ), type "ubuntu."
- Click on the Advanced button.
- Advanced Site Settings window
- Under SSH ( 1 ), click on Authentication ( two )
- 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.
- 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.
-
- Click the Login push button
- The first time you connect to your instance, you will be asked most connecting to an unknown server.
- Click the Yes button to proceed.
- 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.
- 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
-
- Click on the Start push at the extreme left of the Taskbar.
- Scroll down the list of Apps to the Windows Organisation folder.
- Expand the folder and click on Command Prompt.
- Or, click the Beginning button and type "cmd." Select "Command Prompt" from the search results.
- The Command Prompt window volition open up.
Windows 7
-
- Click on the Start button at the left of the Taskbar.
- In the Search programs and files box, type "cmd." Select "Command Prompt" from the search results.
- The Control Prompt volition open up.
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.
-
- 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.
- 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
-
- 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):
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.
-
- 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.
- At the Windows command prompt, navigate to your "Data" folder using the modify directory (cd) control:
C:\> cd Data and press ENTER
-
- 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
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!
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